From 25228df6d13b5e8541672c4cdd84e200ff56a4c4 Mon Sep 17 00:00:00 2001 From: Nathan Reiner Date: Wed, 19 Nov 2025 18:58:54 +0100 Subject: add profile settings to backend and add image loader --- static/api/profile.js | 7 +++++++ static/api/rest.js | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) (limited to 'static/api') diff --git a/static/api/profile.js b/static/api/profile.js index a9ee591..ec633e0 100644 --- a/static/api/profile.js +++ b/static/api/profile.js @@ -1 +1,8 @@ import * as rest from './rest.js'; + +export async function set(name, birthday) { + await rest.post('/api/profile/set', { + full_name: name, + birthday: birthday, + }); +} diff --git a/static/api/rest.js b/static/api/rest.js index b314615..6b14034 100644 --- a/static/api/rest.js +++ b/static/api/rest.js @@ -14,7 +14,7 @@ export function get(url) { return handle_fetch(fetch(url)); } -export async function post(url, body) { +export function post(url, body) { return handle_fetch(fetch(url, { method: 'POST', body: JSON.stringify(body), -- cgit v1.2.3-70-g09d2