Compare commits
1 Commits
2f805c0772
...
version/0.
| Author | SHA1 | Date | |
|---|---|---|---|
| 170695f9ff |
@@ -1,6 +1,6 @@
|
||||
services:
|
||||
app:
|
||||
image: chiko/77th_eventcalendarntfy:v0.1.4
|
||||
image: chiko/77th_eventcalendarntfy:v0.1.5
|
||||
build: .
|
||||
volumes:
|
||||
- ./data/db:/opt/app/data/db
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"version": "0.1.4",
|
||||
"version": "0.1.5",
|
||||
"name": "77th_eventcalendarnotification",
|
||||
"module": "./src/app.ts",
|
||||
"type": "module",
|
||||
|
||||
@@ -102,9 +102,8 @@ async function events_check_for_notification() {
|
||||
await sendNotification( ev.get_title(), ev.get_body(), notificationOptions );
|
||||
if ( ev.notification == "removed" ) {
|
||||
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 & {
|
||||
event_uid: number
|
||||
notification: "new" | "changed" | "removed" | "done" | "deleted"
|
||||
notification: "new" | "changed" | "removed" | "done"
|
||||
}
|
||||
|
||||
export type TEventEntityNew = Omit<TEventEntity, "event_uid">
|
||||
@@ -176,7 +176,8 @@ export class Event implements TEventEntity {
|
||||
set_notification ( newValue: TEventEntity["notification"], db: Database ) {
|
||||
const query = db.prepare(
|
||||
`UPDATE events
|
||||
SET notification = $notification
|
||||
SET notification = $notification,
|
||||
deleteDate = NULL
|
||||
WHERE event_uid = $event_uid;`
|
||||
);
|
||||
query.get({$notification: newValue, $event_uid: this.event_uid });
|
||||
@@ -185,8 +186,7 @@ export class Event implements TEventEntity {
|
||||
set_deleted ( db: Database ) {
|
||||
const query = db.prepare(
|
||||
`UPDATE events
|
||||
SET notification = 'deleted',
|
||||
deleteDate = $deleteDate
|
||||
SET deleteDate = $deleteDate
|
||||
WHERE event_uid = $event_uid;`
|
||||
);
|
||||
query.get({
|
||||
|
||||
Reference in New Issue
Block a user