97 lines
1.9 KiB
GraphQL
97 lines
1.9 KiB
GraphQL
mutation createActivityLog(
|
|
$userId: String!
|
|
|
|
$date: Timestamp!
|
|
$hourStart: String
|
|
$hourEnd: String
|
|
$totalhours: String
|
|
$iconType: ActivityIconType
|
|
$iconColor: String
|
|
|
|
$title: String!
|
|
$description: String!
|
|
$isRead: Boolean
|
|
$activityType: ActivityType!
|
|
) @auth(level: USER) {
|
|
activityLog_insert(
|
|
data: {
|
|
userId: $userId
|
|
|
|
date: $date
|
|
hourStart: $hourStart
|
|
hourEnd: $hourEnd
|
|
totalhours: $totalhours
|
|
iconType: $iconType
|
|
iconColor: $iconColor
|
|
|
|
title: $title
|
|
description: $description
|
|
isRead: $isRead
|
|
activityType: $activityType
|
|
}
|
|
)
|
|
}
|
|
|
|
mutation updateActivityLog(
|
|
$id: UUID!
|
|
|
|
$userId: String
|
|
|
|
$date: Timestamp
|
|
$hourStart: String
|
|
$hourEnd: String
|
|
$totalhours: String
|
|
$iconType: ActivityIconType
|
|
$iconColor: String
|
|
|
|
$title: String
|
|
$description: String
|
|
$isRead: Boolean
|
|
$activityType: ActivityType
|
|
) @auth(level: USER) {
|
|
activityLog_update(
|
|
id: $id
|
|
data: {
|
|
userId: $userId
|
|
|
|
date: $date
|
|
hourStart: $hourStart
|
|
hourEnd: $hourEnd
|
|
totalhours: $totalhours
|
|
iconType: $iconType
|
|
iconColor: $iconColor
|
|
|
|
title: $title
|
|
description: $description
|
|
isRead: $isRead
|
|
activityType: $activityType
|
|
}
|
|
)
|
|
}
|
|
|
|
# ----------------------------------------------------------
|
|
# MARK AS READ (single)
|
|
# ----------------------------------------------------------
|
|
mutation markActivityLogAsRead($id: UUID!) @auth(level: USER) {
|
|
activityLog_update(
|
|
id: $id
|
|
data: { isRead: true }
|
|
)
|
|
}
|
|
|
|
# ----------------------------------------------------------
|
|
# MARK MANY AS READ (correct op name in your DC)
|
|
# ----------------------------------------------------------
|
|
mutation markActivityLogsAsRead(
|
|
$ids: [UUID!]!
|
|
) @auth(level: USER) {
|
|
activityLog_updateMany(
|
|
where: { id: { in: $ids } }
|
|
data: { isRead: true }
|
|
)
|
|
}
|
|
|
|
mutation deleteActivityLog($id: UUID!) @auth(level: USER) {
|
|
activityLog_delete(id: $id)
|
|
}
|