@ -4235,6 +4235,10 @@ class PlApiClient {
|
||||
*/
|
||||
getReports: async (params?: AdminGetReportsParams) => {
|
||||
if (this.features.mastodonAdmin) {
|
||||
if (params?.resolved === undefined && (this.features.version.software === GOTOSOCIAL || this.features.version.software === PLEROMA)) {
|
||||
if (!params) params = {};
|
||||
params.resolved = false;
|
||||
}
|
||||
return this.#paginatedGet('/api/v1/admin/reports', { params }, adminReportSchema);
|
||||
} else {
|
||||
return this.#paginatedPleromaReports({
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "pl-api",
|
||||
"version": "1.0.0-rc.88",
|
||||
"version": "1.0.0-rc.89",
|
||||
"type": "module",
|
||||
"homepage": "https://codeberg.org/mkljczk/pl-fe/src/branch/develop/packages/pl-api",
|
||||
"repository": {
|
||||
|
||||
@ -105,7 +105,7 @@
|
||||
"multiselect-react-dropdown": "^2.0.25",
|
||||
"mutative": "^1.1.0",
|
||||
"path-browserify": "^1.0.1",
|
||||
"pl-api": "^1.0.0-rc.88",
|
||||
"pl-api": "^1.0.0-rc.89",
|
||||
"postcss": "^8.5.3",
|
||||
"process": "^0.11.10",
|
||||
"punycode": "^2.1.1",
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
import { useInfiniteQuery, useMutation, useQuery, useQueryClient } from '@tanstack/react-query';
|
||||
|
||||
import { useClient } from 'pl-fe/hooks/use-client';
|
||||
import { useInstance } from 'pl-fe/hooks/use-instance';
|
||||
import { useOwnAccount } from 'pl-fe/hooks/use-own-account';
|
||||
|
||||
import { filterById } from '../utils/filter-id';
|
||||
@ -33,11 +34,12 @@ const pendingReportsQuery = makePaginatedResponseQueryOptions(
|
||||
|
||||
const usePendingReportsCount = () => {
|
||||
const { account } = useOwnAccount();
|
||||
const instance = useInstance();
|
||||
|
||||
return useInfiniteQuery({
|
||||
...pendingReportsQuery,
|
||||
select: (data) => data.pages.at(-1)?.total || data.pages.map(page => page.items).flat().length || 0,
|
||||
enabled: account?.is_admin || account?.is_moderator,
|
||||
enabled: !!instance.domain && (account?.is_admin || account?.is_moderator),
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
@ -6998,10 +6998,10 @@ pkg-dir@^4.1.0:
|
||||
dependencies:
|
||||
find-up "^4.0.0"
|
||||
|
||||
pl-api@^1.0.0-rc.88:
|
||||
version "1.0.0-rc.88"
|
||||
resolved "https://registry.yarnpkg.com/pl-api/-/pl-api-1.0.0-rc.88.tgz#569da6057b8e16cfe3442a5fb9391fe86d80f8f1"
|
||||
integrity sha512-h3gCwm4w7D9U2RRoDw+tmnVabO+ly5q96/NtdsHYRVajCiGeJFce647gSKzPuF3rPfhn9RJRsnIfiekFZydYaQ==
|
||||
pl-api@^1.0.0-rc.89:
|
||||
version "1.0.0-rc.89"
|
||||
resolved "https://registry.yarnpkg.com/pl-api/-/pl-api-1.0.0-rc.89.tgz#cfe4b0458fb629c1bc4dab6448b9d257818369ab"
|
||||
integrity sha512-lEVXNLucbzw4aIWlpaaMRBmIFAvaPiyp/wUCZE1hisuvM7vuRq1JyCLa96uPs3TFjcYERfYZUH3+uIkKyjhfIQ==
|
||||
dependencies:
|
||||
blurhash "^2.0.5"
|
||||
http-link-header "^1.1.3"
|
||||
|
||||
Reference in New Issue
Block a user