import { prisma } from "@/module/_global";

export default async function createLogUserMobile({ act, desc, table, data, user }: { act: string, desc: string, table: string, data: string, user: string }) {
   try {
      await prisma.userLog.create({
         data: {
            idUser: user,
            action: act,
            desc: desc,
            idContent: data,
            tbContent: table
         }
      })

      return { success: true, message: "Success" }

   } catch (error) {
      console.error(error)
      return { success: false, message: "Internal Server Error" }
   }
}