feat: timezone + dateFOrmat + appearance profile settings
This commit is contained in:
		| @@ -147,12 +147,22 @@ module.exports = { | ||||
|           throw new WIKI.Error.AuthAccountNotVerified() | ||||
|         } | ||||
|  | ||||
|         if (!['', 'DD/MM/YYYY', 'DD.MM.YYYY', 'MM/DD/YYYY', 'YYYY-MM-DD', 'YYYY/MM/DD'].includes(args.dateFormat)) { | ||||
|           throw new WIKI.Error.InputInvalid() | ||||
|         } | ||||
|  | ||||
|         if (!['', 'light', 'dark'].includes(args.appearance)) { | ||||
|           throw new WIKI.Error.InputInvalid() | ||||
|         } | ||||
|  | ||||
|         await WIKI.models.users.updateUser({ | ||||
|           id: usr.id, | ||||
|           name: _.trim(args.name), | ||||
|           jobTitle: _.trim(args.jobTitle), | ||||
|           location: _.trim(args.location), | ||||
|           timezone: args.timezone | ||||
|           timezone: args.timezone, | ||||
|           dateFormat: args.dateFormat, | ||||
|           appearance: args.appearance | ||||
|         }) | ||||
|  | ||||
|         const newToken = await WIKI.models.users.refreshToken(usr.id) | ||||
|   | ||||
| @@ -57,6 +57,8 @@ type UserMutation { | ||||
|     location: String | ||||
|     jobTitle: String | ||||
|     timezone: String | ||||
|     dateFormat: String | ||||
|     appearance: String | ||||
|   ): DefaultResponse @auth(requires: ["manage:users", "manage:system"]) | ||||
|  | ||||
|   delete( | ||||
| @@ -84,6 +86,8 @@ type UserMutation { | ||||
|     location: String! | ||||
|     jobTitle: String! | ||||
|     timezone: String! | ||||
|     dateFormat: String! | ||||
|     appearance: String! | ||||
|   ): UserTokenResponse | ||||
|  | ||||
|   changePassword( | ||||
| @@ -128,6 +132,8 @@ type User { | ||||
|   location: String! | ||||
|   jobTitle: String! | ||||
|   timezone: String! | ||||
|   dateFormat: String! | ||||
|   appearance: String! | ||||
|   createdAt: Date! | ||||
|   updatedAt: Date! | ||||
|   lastLoginAt: Date | ||||
| @@ -145,6 +151,8 @@ type UserProfile { | ||||
|   location: String! | ||||
|   jobTitle: String! | ||||
|   timezone: String! | ||||
|   dateFormat: String! | ||||
|   appearance: String! | ||||
|   createdAt: Date! | ||||
|   updatedAt: Date! | ||||
|   lastLoginAt: Date | ||||
|   | ||||
		Reference in New Issue
	
	Block a user