From 5c1f1983979b8719466e9e416cbcc97ae9418551 Mon Sep 17 00:00:00 2001 From: Emma Alexia Date: Sat, 19 Apr 2025 08:49:23 -0400 Subject: [PATCH] Add ability to delete user icon (#3383) * Add user icon delete route By request of moderation, but also just generally nice to have * Add relevant docs and frontend * Add v2 version --- apps/docs/public/openapi.yaml | 20 ++++++- apps/frontend/src/pages/settings/profile.vue | 21 +++++++- ...cfcb9e6a117a4efc070438606e4c94103a9a4.json | 14 +++++ apps/labrinth/src/routes/v2/users.rs | 23 ++++++++ apps/labrinth/src/routes/v3/users.rs | 54 +++++++++++++++++++ packages/ui/src/utils/common-messages.ts | 4 ++ 6 files changed, 134 insertions(+), 2 deletions(-) create mode 100644 apps/labrinth/.sqlx/query-483cb875ba81c7563a2f7220158cfcb9e6a117a4efc070438606e4c94103a9a4.json diff --git a/apps/docs/public/openapi.yaml b/apps/docs/public/openapi.yaml index da9504ae..94332db3 100644 --- a/apps/docs/public/openapi.yaml +++ b/apps/docs/public/openapi.yaml @@ -1,7 +1,7 @@ openapi: '3.0.0' info: - version: v2.7.0/15cf3fc + version: v2.7.0/366f528 title: Labrinth termsOfService: https://modrinth.com/legal/terms contact: @@ -3018,6 +3018,24 @@ paths: $ref: '#/components/schemas/InvalidInputError' '404': description: The requested item(s) were not found or no authorization to access the requested item(s) + delete: + summary: Remove user's avatar + operationId: deleteUserIcon + tags: + - users + security: + - TokenAuth: ['USER_WRITE'] + responses: + '204': + description: Expected response to a valid request + '400': + description: Request was invalid, see given error + content: + application/json: + schema: + $ref: '#/components/schemas/InvalidInputError' + '404': + description: The requested item(s) were not found or no authorization to access the requested item(s) /user/{id|username}/projects: parameters: - $ref: '#/components/parameters/UserIdentifier' diff --git a/apps/frontend/src/pages/settings/profile.vue b/apps/frontend/src/pages/settings/profile.vue index 1fd3e4e0..7395c1d4 100644 --- a/apps/frontend/src/pages/settings/profile.vue +++ b/apps/frontend/src/pages/settings/profile.vue @@ -32,6 +32,10 @@ > +