diff options
author | Hugo Hörnquist <hugo@lysator.liu.se> | 2023-09-13 00:01:28 +0200 |
---|---|---|
committer | Hugo Hörnquist <hugo@lysator.liu.se> | 2023-09-13 00:01:28 +0200 |
commit | a82b6c772089aa46e30c6c89ef48f514294df3cb (patch) | |
tree | e25d9b6fd1fefe8b6ac293a5c0b53293872a8f54 /static/ts/server_connect.ts | |
parent | Add basic documentation for lens. (diff) | |
parent | Even more documentation. (diff) | |
download | calp-a82b6c772089aa46e30c6c89ef48f514294df3cb.tar.gz calp-a82b6c772089aa46e30c6c89ef48f514294df3cb.tar.xz |
Merge branch 'next' into datarewrite-structures
Diffstat (limited to '')
-rw-r--r-- | static/ts/server_connect.ts (renamed from static/server_connect.ts) | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/static/server_connect.ts b/static/ts/server_connect.ts index 29f5bab2..ad4bc9eb 100644 --- a/static/server_connect.ts +++ b/static/ts/server_connect.ts @@ -1,3 +1,9 @@ +/** + * Procedures for interfacing with the backend server. + * + * @module + */ + export { create_event, remove_event } import { jcal_to_xcal } from './jcal' @@ -6,6 +12,15 @@ import { uid } from './types' import { vcal_objects } from './globals' import { PopupElement } from './components/popup-element' +/** + * Requests that the server permanently remove the event with the given + * unique id from its persistant storage. + * + * If the server responds with a success also delete it from our local + * store (`vcal_objects`). + * + * // TODO link to our backend flow here +*/ async function remove_event(uid: uid) { let element = vcal_objects.get(uid); if (!element) { @@ -55,6 +70,13 @@ async function remove_event(uid: uid) { // ]; // } +/** + * Packs up the given event and sends it to the server to either be + * created, or simply be updated in the persistant database. + + * Also does some minor updates registered components, to show that the + * event is actually created. +*/ async function create_event(event: VEvent) { // let xml = event.getElementsByTagName("icalendar")[0].outerHTML |