Compare commits

...

2 Commits

2 changed files with 9 additions and 5 deletions

View File

@ -512,7 +512,11 @@ export function updateUser(data: {id: number, gender?: string, name?: string, ad
const query = user_database.prepare(update_query)
const result = query.run(data)
return get_user_by_name(data?.name ?? "") // GET USER BY lastRowId from result
const user_entry = get_user_entry_by_id(data.id)
if (!user_entry) {
throw new Error("Failed to retrieve updated user")
}
return new User(user_entry, new Database(get_user_db_name(data.id), { create: false, strict: true }) ) // Database should already exist
}
export function update_user_password(user_id: number, password: string) {

View File

@ -59,13 +59,13 @@ const TEMPLATE_EST = "template-est.tex";
const TEMPLATE_EST_PATH = `./templates/${TEMPLATE_EST}`;
const SALUTATION: Record<string, string> = {
m: "Herrn",
w: "Frau"
M: "Herrn",
W: "Frau"
}
const GENDER_END: Record<string, string> = {
m: "",
w: "in",
M: "",
W: "in",
}
// this may be a race condition???