fix(api): Use POST instead of GET for API endpoints that mutate state (#877)

This commit is contained in:
TheCatLady
2021-02-08 20:27:48 -05:00
committed by GitHub
parent d163e29459
commit ff0b5ed441
16 changed files with 101 additions and 73 deletions

View File

@@ -30,7 +30,7 @@ const RequestBlock: React.FC<RequestBlockProps> = ({ request, onUpdate }) => {
const updateRequest = async (type: 'approve' | 'decline'): Promise<void> => {
setIsUpdating(true);
await axios.get(`/api/v1/request/${request.id}/${type}`);
await axios.post(`/api/v1/request/${request.id}/${type}`);
if (onUpdate) {
onUpdate();