Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(adminPanel): Miscellaneous Bug fixes (Tiny) #5891

Merged
merged 3 commits into from
Sep 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ import { upload } from '../api';
const FILE_NAME = 'testData';

export const useUploadTestData = () =>
useMutation('uploadTestData', file => upload('uploadTestData', {}, FILE_NAME, file));
useMutation(['uploadTestData'], file => upload('uploadTestData', {}, FILE_NAME, file));
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ import { get } from '../api';
import { DEFAULT_REACT_QUERY_OPTIONS } from '../constants';

export const useMapOverlays = () =>
useQuery('mapOverlays', () => get('mapOverlays'), {
useQuery(['mapOverlays'], () => get('mapOverlays'), {
...DEFAULT_REACT_QUERY_OPTIONS,
});
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { DEFAULT_REACT_QUERY_OPTIONS } from '../constants';

export const useProjects = columns =>
useQuery(
'projects',
['projects'],
async () => {
const defaultColumns = ['project.code', 'entity.name'];
const endpoint = stringifyQuery(undefined, 'projects', {
Expand Down
2 changes: 1 addition & 1 deletion packages/admin-panel/src/api/mutations/useLogout.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { post } from '../../VizBuilderApp/api';
export const useLogout = onSuccess => {
const queryClient = useQueryClient();

return useMutation('logout', () => post('logout'), {
return useMutation(['logout'], () => post('logout'), {
onSuccess: () => {
queryClient.invalidateQueries();
if (onSuccess) onSuccess();
Expand Down
2 changes: 1 addition & 1 deletion packages/lesmis/src/api/queries/useEntitiesData.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ const PROJECT_PARAMS = {

export const useProjectEntitiesData = () => {
const query = useQuery(
'entities',
['entities'],
() => get(`entities/${PROJECT_CODE}`, { params: PROJECT_PARAMS }),
{
staleTime: 1000 * 60 * 60 * 1,
Expand Down
2 changes: 1 addition & 1 deletion packages/lesmis/src/api/queries/useUser.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { useQuery } from '@tanstack/react-query';
import { get } from '../api';

export const useUser = options => {
const query = useQuery('user', () => get('user'), {
const query = useQuery(['user'], () => get('user'), {
retry: 0,
// should be refetched in the background every hour
staleTime: 1000 * 60 * 60 * 1,
Expand Down