Skip to content

Commit

Permalink
refactor: fix lint errors
Browse files Browse the repository at this point in the history
  • Loading branch information
pyphilia committed Nov 8, 2023
1 parent 5987b7e commit 700c7c2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/config/queryClient.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { configureQueryClient } from '@graasp/apps-query-client';
import { REACT_APP_API_HOST, REACT_APP_GRAASP_APP_KEY } from './env';
import { ENABLE_MOCK_API } from './settings';
import { APP_KEY, ENABLE_MOCK_API, REACT_APP_API_HOST } from './settings';

const {
queryClient,
Expand All @@ -11,14 +10,14 @@ const {
QUERY_KEYS,
mutations,
} = configureQueryClient({
API_HOST: REACT_APP_API_HOST!,
API_HOST: REACT_APP_API_HOST,
notifier: (data) => {
console.log('notifier: ', data);
},
keepPreviousData: true,
// avoid refetching when same data are closely fetched
staleTime: 1000, // ms
GRAASP_APP_KEY: REACT_APP_GRAASP_APP_KEY!,
GRAASP_APP_KEY: APP_KEY,
isStandalone: ENABLE_MOCK_API,
});

Expand Down
5 changes: 5 additions & 0 deletions src/config/settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@ export const RESPONSES_COLUMNS = ['Student', 'Input', 'Feedback', 'Actions'];
export const REACT_APP_API_HOST =
process.env.REACT_APP_API_HOST ?? 'http://localhost:3000';

if (!process.env.REACT_APP_GRAASP_APP_KEY) {
throw new Error('REACT_APP_GRAASP_APP_KEY must be defined');
}
export const APP_KEY = process.env.REACT_APP_GRAASP_APP_KEY;

export const ENABLE_MOCK_API = REACT_APP_ENABLE_MOCK_API === 'true';

export const SETTINGS = {
Expand Down

0 comments on commit 700c7c2

Please sign in to comment.