migrate to app dir and ssr
This commit is contained in:
@@ -1,9 +1,25 @@
|
||||
import { db } from '../db';
|
||||
|
||||
export function getOrganizationBySlug(slug: string) {
|
||||
return db.organization.findUniqueOrThrow({
|
||||
export type IServiceOrganization = Awaited<
|
||||
ReturnType<typeof getOrganizations>
|
||||
>[number];
|
||||
|
||||
export function getOrganizations() {
|
||||
return db.organization.findMany({
|
||||
where: {
|
||||
slug,
|
||||
// users: {
|
||||
// some: {
|
||||
// id: '1',
|
||||
// },
|
||||
// }
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
export function getOrganizationById(id: string) {
|
||||
return db.organization.findUniqueOrThrow({
|
||||
where: {
|
||||
id,
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user