Fix #53
This commit is contained in:
@@ -22,7 +22,7 @@ export default async function staffTimeRoutes(server: FastifyInstance) {
|
||||
|
||||
server.post("/staff/time/event", async (req, reply) => {
|
||||
try {
|
||||
const userId = req.user.user_id
|
||||
const actorId = req.user.user_id;
|
||||
const tenantId = req.user.tenant_id
|
||||
|
||||
const body = req.body as any
|
||||
@@ -35,17 +35,15 @@ export default async function staffTimeRoutes(server: FastifyInstance) {
|
||||
|
||||
const dataToInsert = {
|
||||
tenant_id: tenantId,
|
||||
user_id: userId,
|
||||
user_id: body.user_id,
|
||||
actortype: "user",
|
||||
actoruser_id: userId,
|
||||
actoruser_id: actorId,
|
||||
eventtime: normalizeDate(body.eventtime),
|
||||
eventtype: body.eventtype,
|
||||
source: "WEB",
|
||||
payload: body.payload // Payload (z.B. Description) mit speichern
|
||||
}
|
||||
|
||||
console.log(dataToInsert)
|
||||
|
||||
const [created] = await server.db
|
||||
.insert(stafftimeevents)
|
||||
//@ts-ignore
|
||||
|
||||
Reference in New Issue
Block a user