mirror of
https://github.com/versia-pub/server.git
synced 2026-03-13 05:49:16 +01:00
refactor(config): 🔥 Replace config validation with Zod
This commit is contained in:
parent
093337dd4f
commit
fb31375b74
15 changed files with 543 additions and 3491 deletions
|
|
@ -365,8 +365,8 @@ export class User {
|
|||
: await Bun.password.hash(data.password),
|
||||
email: data.email,
|
||||
note: data.bio ?? "",
|
||||
avatar: data.avatar ?? config.defaults.avatar,
|
||||
header: data.header ?? config.defaults.avatar,
|
||||
avatar: data.avatar ?? config.defaults.avatar ?? "",
|
||||
header: data.header ?? config.defaults.avatar ?? "",
|
||||
isAdmin: data.admin ?? false,
|
||||
publicKey: keys.public_key,
|
||||
fields: [],
|
||||
|
|
@ -399,7 +399,7 @@ export class User {
|
|||
* @returns The raw URL for the user's header
|
||||
*/
|
||||
getHeaderUrl(config: Config) {
|
||||
if (!this.user.header) return config.defaults.header;
|
||||
if (!this.user.header) return config.defaults.header || "";
|
||||
return this.user.header;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue