mirror of
https://github.com/vas3k/TaxHacker.git
synced 2026-01-06 05:30:08 -06:00
feat: invoice generator
This commit is contained in:
18
models/apps.ts
Normal file
18
models/apps.ts
Normal file
@@ -0,0 +1,18 @@
|
||||
import { prisma } from "@/lib/db"
|
||||
import { User } from "@prisma/client"
|
||||
|
||||
export const getAppData = async (user: User, app: string) => {
|
||||
const appData = await prisma.appData.findUnique({
|
||||
where: { userId_app: { userId: user.id, app } },
|
||||
})
|
||||
|
||||
return appData?.data
|
||||
}
|
||||
|
||||
export const setAppData = async (user: User, app: string, data: any) => {
|
||||
await prisma.appData.upsert({
|
||||
where: { userId_app: { userId: user.id, app } },
|
||||
update: { data },
|
||||
create: { userId: user.id, app, data },
|
||||
})
|
||||
}
|
||||
Reference in New Issue
Block a user