chore: Add createdAt default to eventtype table and remove extension (#24075)
This commit is contained in:
1 parent
d1c5576d4f
commit
82dfca8272
4 files changed
+3
-31
No files matched your search
@@ -1,27 +0,0 @@
|
||||
import { Prisma } from "@calcom/prisma/client";
|
||||
|
||||
export function eventTypeTimestampsExtension() {
|
||||
return Prisma.defineExtension({
|
||||
query: {
|
||||
eventType: {
|
||||
async create({ args, query }) {
|
||||
const now = new Date();
|
||||
args.data.createdAt = now;
|
||||
return query(args);
|
||||
},
|
||||
async createMany({ args, query }) {
|
||||
const now = new Date();
|
||||
if (Array.isArray(args.data)) {
|
||||
args.data = args.data.map((item) => ({
|
||||
...item,
|
||||
createdAt: now,
|
||||
}));
|
||||
} else {
|
||||
args.data.createdAt = now;
|
||||
}
|
||||
return query(args);
|
||||
},
|
||||
},
|
||||
},
|
||||
});
|
||||
}
|
||||
Reference in new issue
Block a user