Add support for S3-backed image storage
This commit is contained in:
1 parent
7fcb2eb747
commit
96bfef4575
25 files changed
+2678
-93
No files matched your search
@@ -9,6 +9,7 @@ enum ColorScheme {
|
||||
type UserInfo = {
|
||||
name: string;
|
||||
patreon: boolean;
|
||||
image_uploads: boolean;
|
||||
preferences: {
|
||||
timezone: string | null;
|
||||
reset_inputs_on_create: boolean;
|
||||
@@ -126,6 +127,13 @@ export const fetchUserInfo = () => ({
|
||||
staleTime: USER_INFO_STALE_TIME,
|
||||
});
|
||||
|
||||
export const uploadImage = (file: File) =>
|
||||
axios
|
||||
.post<{ url: string }>("/dashboard/api/images", file, {
|
||||
headers: { "Content-Type": "application/octet-stream" },
|
||||
})
|
||||
.then((response) => response.data.url);
|
||||
|
||||
export const patchUserInfo = () => ({
|
||||
mutationFn: (userInfo: UpdateUserInfo) => axios.patch(`/dashboard/api/user`, userInfo),
|
||||
});
|
||||
@@ -236,7 +244,7 @@ export const fetchGuildTodos = (guild: string) => ({
|
||||
});
|
||||
|
||||
export const patchGuildTodo = (guild: string) => ({
|
||||
mutationFn: ({id, todo}) => axios.patch(`/dashboard/api/guild/${guild}/todos/${id}`, todo),
|
||||
mutationFn: ({ id, todo }) => axios.patch(`/dashboard/api/guild/${guild}/todos/${id}`, todo),
|
||||
});
|
||||
|
||||
export const postGuildTodo = (guild: string) => ({
|
||||
|
||||
Reference in new issue
Block a user