Updated DB models
This commit is contained in:
@ -1,18 +1,18 @@
|
||||
import { Server } from 'socket.io'
|
||||
import { TSocket } from '../../../utilities/Types'
|
||||
import prisma from '../../../utilities/Prisma'
|
||||
import type { SpriteImage } from '@prisma/client'
|
||||
import type { SpriteAction } from '@prisma/client'
|
||||
import path from 'path'
|
||||
import fs from 'fs'
|
||||
|
||||
type uploadSpriteImage = SpriteImage & {
|
||||
type uploadSpriteAction = SpriteAction & {
|
||||
base64?: string
|
||||
}
|
||||
|
||||
type Payload = {
|
||||
id: string
|
||||
name: string
|
||||
spriteImages: uploadSpriteImage[]
|
||||
spriteActions: uploadSpriteAction[]
|
||||
}
|
||||
|
||||
/**
|
||||
@ -33,11 +33,11 @@ export default function (socket: TSocket, io: Server) {
|
||||
},
|
||||
data: {
|
||||
name: data.name,
|
||||
spriteImages: {
|
||||
spriteActions: {
|
||||
deleteMany: {
|
||||
spriteId: data.id
|
||||
},
|
||||
create: data.spriteImages
|
||||
create: data.spriteActions
|
||||
}
|
||||
}
|
||||
})
|
||||
|
Reference in New Issue
Block a user