Skip to content

Commit

Permalink
chore: add react query library for API calls (#174)
Browse files Browse the repository at this point in the history
  • Loading branch information
edendattox authored Jan 8, 2024
1 parent eb936cf commit 8044675
Show file tree
Hide file tree
Showing 13 changed files with 382 additions and 257 deletions.
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,15 @@
"js-cookie": "^3.0.5",
"just-compare": "^2.3.0",
"long": "^5.2.3",
"nice-grpc-common": "^2.0.2",
"ms": "^2.1.3",
"nice-grpc-common": "^2.0.2",
"nice-grpc-web": "^3.3.2",
"protobufjs": "^7.2.5",
"react": "^18.2.0",
"react-beautiful-dnd": "^13.1.1",
"react-dom": "^18.2.0",
"react-error-boundary": "^4.0.10",
"react-query": "^3.39.3",
"react-resizable-panels": "^0.0.53",
"react-router-dom": "^6.14.0",
"react-window": "^1.8.9"
Expand Down
92 changes: 80 additions & 12 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/api/axios.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import axios from 'axios';

const baseURL = import.meta.env.VITE_PARSEABLE_URL ?? '/';

const instance = axios.create({ baseURL, validateStatus: () => true, withCredentials: true });
const instance = axios.create({ baseURL, withCredentials: true });

instance.interceptors.request.use(
(request) => {
Expand Down
6 changes: 3 additions & 3 deletions src/api/logStream.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,15 @@ export const getLogStreamAlerts = (streamName: string) => {
};

export const putLogStreamAlerts = (streamName: string, data: any) => {
return Axios().put(LOG_STREAMS_ALERTS_URL(streamName), data);
return Axios().put(LOG_STREAMS_ALERTS_URL(streamName), JSON.parse(data));
};

export const getLogStreamRetention = (streamName: string) => {
return Axios().get(LOG_STREAMS_RETRNTION_URL(streamName));
};

export const putLogStreamRetention = (streamName: string, data: any) => {
return Axios().put(LOG_STREAMS_RETRNTION_URL(streamName), data);
return Axios().put(LOG_STREAMS_RETRNTION_URL(streamName), JSON.parse(data));
};

export const getLogStreamStats = (streamName: string) => {
Expand All @@ -39,4 +39,4 @@ export const getLogStreamStats = (streamName: string) => {

export const deleteLogStream = (streamName: string) => {
return Axios().delete(DELETE_STREAMS_URL(streamName));
}
};
21 changes: 16 additions & 5 deletions src/components/Mantine/theme.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -224,19 +224,30 @@ export const theme: MantineThemeOverride = {
color: colors.white[0],
},
};
}
},
},

PasswordInput: {
styles: ({ colors }) => {
return {
input: {
border: `${sizing.px} ${colors.gray[2]} solid`,
borderRadius: 'md',

},
};
}
}
},
},
Switch: {
styles: () => {
return {
track: {
border: 'none',
cursor: 'pointer',
},
thumb: {
border: 'none',
},
};
},
},
},
};
Loading

0 comments on commit 8044675

Please sign in to comment.