Compare commits
2 Commits
aed2db9360
...
2b15580e3c
| Author | SHA1 | Date |
|---|---|---|
|
|
2b15580e3c | |
|
|
07b7477940 |
|
|
@ -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) {
|
||||
|
|
|
|||
|
|
@ -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???
|
||||
|
|
|
|||
Loading…
Reference in New Issue