mirror of
https://github.com/documenso/documenso.git
synced 2025-11-10 04:22:32 +10:00
23 lines
430 B
TypeScript
23 lines
430 B
TypeScript
import { prisma } from '@documenso/prisma';
|
|
|
|
export interface GetFieldsForTemplateOptions {
|
|
templateId: number;
|
|
userId: number;
|
|
}
|
|
|
|
export const getFieldsForTemplate = async ({ templateId, userId }: GetFieldsForTemplateOptions) => {
|
|
const fields = await prisma.field.findMany({
|
|
where: {
|
|
templateId,
|
|
Template: {
|
|
userId,
|
|
},
|
|
},
|
|
orderBy: {
|
|
id: 'asc',
|
|
},
|
|
});
|
|
|
|
return fields;
|
|
};
|