feat: implement revoke access token with RQ

This commit is contained in:
Rıdvan Akca
2024-04-25 14:17:18 +02:00
committed by Ali BARIN
parent 68d1719b11
commit 363874de6a
2 changed files with 23 additions and 0 deletions

View File

@@ -0,0 +1,15 @@
import { useMutation } from '@tanstack/react-query';
import api from 'helpers/api';
export default function useRevokeAccessToken(token) {
const query = useMutation({
mutationFn: async () => {
const { data } = await api.delete(`/v1/access-tokens/${token}`);
return data;
},
});
return query;
}