added tons of features

This commit is contained in:
2025-02-05 08:01:14 +02:00
parent 4ae0d8c545
commit 8138da6b1d
195 changed files with 12619 additions and 415 deletions

21
actions/auth/common.ts Normal file
View File

@@ -0,0 +1,21 @@
'use server'
import {getUserWithAccount} from '@prisma/client/sql'
import {getAccountByUserId} from '@/data/accout'
import {getUserById} from '@/data/user'
import {db} from '@/lib/db/prisma/client'
export const exisingUser = async (id: string | number) => {
return await getUserById(id)
}
export const exisingUserAccount = async (userId: string | number) => {
return await getAccountByUserId(userId)
}
export const getUserAccountByUserId = async (userId: string | number) => {
const user = await db.$queryRawTyped(getUserWithAccount(userId))
return user.length > 0 ? user[0] : null
}