Compare commits
7 Commits
version/0.
...
c6ec442c2b
| Author | SHA1 | Date | |
|---|---|---|---|
| c6ec442c2b | |||
| 3e5032caf3 | |||
| 2f805c0772 | |||
| 8aef42396e | |||
| a37d95709f | |||
| 152c1bcba0 | |||
| ae569b7739 |
@@ -102,8 +102,9 @@ async function events_check_for_notification() {
|
|||||||
await sendNotification( ev.get_title(), ev.get_body(), notificationOptions );
|
await sendNotification( ev.get_title(), ev.get_body(), notificationOptions );
|
||||||
if ( ev.notification == "removed" ) {
|
if ( ev.notification == "removed" ) {
|
||||||
ev.set_deleted( db );
|
ev.set_deleted( db );
|
||||||
|
} else {
|
||||||
|
ev.set_notification("done", db);
|
||||||
}
|
}
|
||||||
ev.set_notification("done", db);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ export type TGetEventsOptions = {
|
|||||||
}
|
}
|
||||||
export type TEventEntity = TEvent & {
|
export type TEventEntity = TEvent & {
|
||||||
event_uid: number
|
event_uid: number
|
||||||
notification: "new" | "changed" | "removed" | "done"
|
notification: "new" | "changed" | "removed" | "done" | "deleted"
|
||||||
}
|
}
|
||||||
|
|
||||||
export type TEventEntityNew = Omit<TEventEntity, "event_uid">
|
export type TEventEntityNew = Omit<TEventEntity, "event_uid">
|
||||||
@@ -176,8 +176,7 @@ export class Event implements TEventEntity {
|
|||||||
set_notification ( newValue: TEventEntity["notification"], db: Database ) {
|
set_notification ( newValue: TEventEntity["notification"], db: Database ) {
|
||||||
const query = db.prepare(
|
const query = db.prepare(
|
||||||
`UPDATE events
|
`UPDATE events
|
||||||
SET notification = $notification,
|
SET notification = $notification
|
||||||
deleteDate = NULL
|
|
||||||
WHERE event_uid = $event_uid;`
|
WHERE event_uid = $event_uid;`
|
||||||
);
|
);
|
||||||
query.get({$notification: newValue, $event_uid: this.event_uid });
|
query.get({$notification: newValue, $event_uid: this.event_uid });
|
||||||
@@ -186,7 +185,8 @@ export class Event implements TEventEntity {
|
|||||||
set_deleted ( db: Database ) {
|
set_deleted ( db: Database ) {
|
||||||
const query = db.prepare(
|
const query = db.prepare(
|
||||||
`UPDATE events
|
`UPDATE events
|
||||||
SET deleteDate = $deleteDate
|
SET notification = 'deleted',
|
||||||
|
deleteDate = $deleteDate
|
||||||
WHERE event_uid = $event_uid;`
|
WHERE event_uid = $event_uid;`
|
||||||
);
|
);
|
||||||
query.get({
|
query.get({
|
||||||
|
|||||||
Reference in New Issue
Block a user