Added Event.toString()

This commit is contained in:
2025-10-27 20:01:29 +01:00
parent 7b594614c6
commit c5c5d872d7

View File

@@ -135,6 +135,25 @@ export class Event implements TEventEntity {
this.notification = notification;
this.deleteDate = deleteDate;
}
toString() {
return {
event_uid: this.event_uid,
uid: this.uid,
title: this.title,
description: this.description,
date_at: this.date_at,
time_start: this.time_start,
time_end: this.time_end,
posted_by: this.posted_by,
location: this.location,
event_type: this.event_type,
timezone: this.timezone,
link: this.link,
notification: this.notification,
deleteDate: this.deleteDate
}
}
syncWithDb ( db: Database ) {
const query = db.prepare( `SELECT * FROM events WHERE event_uid = $event_uid;`).as(Event);
const entity = query.get({$event_uid: this.event_uid });