mirror of
https://github.com/superseriousbusiness/gotosocial
synced 2025-06-05 21:59:39 +02:00
[frontend] Basic user moderation actions (#1728)
* remove info banner * update swagger definition for AccountAction * basic user view, suspend action * clean up suspended user display * basic user searching * rename User -> Account for clarity * refactor error boundary component to give better info * appease the linter
This commit is contained in:
@ -78,6 +78,32 @@ const endpoints = (build) => ({
|
||||
}
|
||||
})
|
||||
}),
|
||||
getAccount: build.query({
|
||||
query: (id) => ({
|
||||
url: `/api/v1/accounts/${id}`
|
||||
}),
|
||||
providesTags: (_, __, id) => [{ type: "Account", id }]
|
||||
}),
|
||||
actionAccount: build.mutation({
|
||||
query: ({ id, action, reason }) => ({
|
||||
method: "POST",
|
||||
url: `/api/v1/admin/accounts/${id}/action`,
|
||||
asForm: true,
|
||||
body: {
|
||||
type: action,
|
||||
text: reason
|
||||
}
|
||||
}),
|
||||
invalidatesTags: (_, __, { id }) => [{ type: "Account", id }]
|
||||
}),
|
||||
searchAccount: build.mutation({
|
||||
query: (username) => ({
|
||||
url: `/api/v2/search?q=${encodeURIComponent(username)}&resolve=true`
|
||||
}),
|
||||
transformResponse: (res) => {
|
||||
return res.accounts ?? [];
|
||||
}
|
||||
}),
|
||||
...require("./import-export")(build),
|
||||
...require("./custom-emoji")(build),
|
||||
...require("./reports")(build)
|
||||
|
Reference in New Issue
Block a user