Update schemas and resolve some warnings
This commit is contained in:
@ -1,10 +1,27 @@
|
||||
import axios from "axios";
|
||||
|
||||
enum ColorScheme {
|
||||
System = "system",
|
||||
Dark = "dark",
|
||||
Light = "light",
|
||||
}
|
||||
|
||||
type UserInfo = {
|
||||
name: string;
|
||||
patreon: boolean;
|
||||
timezone: string | null;
|
||||
reset_inputs_on_create: boolean;
|
||||
preferences: {
|
||||
timezone: string | null;
|
||||
reset_inputs_on_create: boolean;
|
||||
dashboard_color_scheme: ColorScheme;
|
||||
use_browser_timezone: boolean;
|
||||
};
|
||||
};
|
||||
|
||||
type UpdateUserInfo = {
|
||||
timezone?: string;
|
||||
reset_inputs_on_create?: boolean;
|
||||
dashboard_color_scheme?: ColorScheme;
|
||||
use_browser_timezone?: boolean;
|
||||
};
|
||||
|
||||
export type GuildInfo = {
|
||||
@ -110,7 +127,7 @@ export const fetchUserInfo = () => ({
|
||||
});
|
||||
|
||||
export const patchUserInfo = () => ({
|
||||
mutationFn: (timezone: string) => axios.patch(`/dashboard/api/user`, { timezone }),
|
||||
mutationFn: (userInfo: UpdateUserInfo) => axios.patch(`/dashboard/api/user`, userInfo),
|
||||
});
|
||||
|
||||
export const fetchUserGuilds = () => ({
|
||||
|
Reference in New Issue
Block a user