Skip to content

Commit 9dabba6

Browse files
committed
feat: #253 re-adding missing updates after merge from upstream
1 parent 96d6061 commit 9dabba6

2 files changed

Lines changed: 6 additions & 4 deletions

File tree

src/taxonomy/data/apiHooks.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@
1313
import { useQuery, useMutation, useQueryClient } from '@tanstack/react-query';
1414
import { camelCaseObject } from '@edx/frontend-platform';
1515
import { getAuthenticatedHttpClient } from '@edx/frontend-platform/auth';
16+
import { useIntl } from '@edx/frontend-platform/i18n';
1617
import { apiUrls, ALL_TAXONOMIES, getApiErrorMessage } from './api';
1718
import * as api from './api';
1819
import type { QueryOptions, TagListData } from './types';
19-
import { useIntl } from '@edx/frontend-platform/i18n';
2020

2121
// Query key patterns. Allows an easy way to clear all data related to a given taxonomy.
2222
// https://github.com/openedx/frontend-app-admin-portal/blob/2ba315d/docs/decisions/0006-tanstack-react-query.rst
@@ -230,9 +230,13 @@ export const useCreateTag = (taxonomyId: number) => {
230230
onSuccess: () => {
231231
queryClient.invalidateQueries({
232232
queryKey: taxonomyQueryKeys.taxonomyTagList(taxonomyId),
233+
refetchType: 'none',
233234
});
234235
// In the metadata, 'tagsCount' (and possibly other fields) will have changed:
235-
queryClient.invalidateQueries({ queryKey: taxonomyQueryKeys.taxonomyMetadata(taxonomyId) });
236+
queryClient.invalidateQueries({
237+
queryKey: taxonomyQueryKeys.taxonomyMetadata(taxonomyId),
238+
refetchType: 'none',
239+
});
236240
},
237241
});
238242
};

src/taxonomy/tag-list/TagListTable.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import React, {
33
useMemo,
44
useEffect,
55
} from 'react';
6-
import { useIntl } from '@edx/frontend-platform/i18n';
76
import type { PaginationState } from '@tanstack/react-table';
87
import { useTagListData, useCreateTag } from '../data/apiHooks';
98
import { TagTree } from './tagTree';
@@ -40,7 +39,6 @@ const TagListTable = ({ taxonomyId, maxDepth }: TagListTableProps) => {
4039
// TODO: Simpler approaches have been suggested. Two options are to just use simple React state:
4140
// `isCurrentlyEditingTag` and `lastCreatedTag`, or to use optimistic updates.
4241
// For reference, see https://github.com/openedx/frontend-app-authoring/pull/2872#discussion_r2880965005.
43-
const intl = useIntl();
4442

4543
const [creatingParentId, setCreatingParentId] = useState<RowId | null>(null);
4644
const [editingRowId, setEditingRowId] = useState<RowId | null>(null);

0 commit comments

Comments
 (0)