23 lines
368 B
TypeScript
23 lines
368 B
TypeScript
import client from '../../prisma/client.ts'
|
|
|
|
export async function chatInit() {
|
|
const existing = client.chatChannel.findFirst({
|
|
where: {
|
|
id: 0,
|
|
},
|
|
})
|
|
|
|
if (!existing) {
|
|
await client.chatChannel.create({
|
|
create: {
|
|
id: 0,
|
|
name: 'Main channel',
|
|
},
|
|
update: null,
|
|
where: {
|
|
id: 0,
|
|
},
|
|
})
|
|
}
|
|
}
|