feat: renamed old frontend and fixed some minor bugs

This commit is contained in:
=
2025-01-06 14:56:49 +05:30
parent 8c902d7699
commit 54377a44d3
2577 changed files with 35240 additions and 35116 deletions
@@ -36,14 +36,16 @@ export const useCreateServiceToken = () => {
// TODO: deprecate
const queryClient = useQueryClient();
return useMutation<CreateServiceTokenRes, {}, CreateServiceTokenDTO>({
return useMutation<CreateServiceTokenRes, object, CreateServiceTokenDTO>({
mutationFn: async (body) => {
const { data } = await apiRequest.post("/api/v2/service-token/", body);
data.serviceToken += `.${body.randomBytes}`;
return data;
},
onSuccess: ({ serviceTokenData: { projectId } }) => {
queryClient.invalidateQueries(serviceTokenKeys.getAllWorkspaceServiceToken(projectId));
queryClient.invalidateQueries({
queryKey: serviceTokenKeys.getAllWorkspaceServiceToken(projectId)
});
}
});
};
@@ -51,13 +53,15 @@ export const useCreateServiceToken = () => {
export const useDeleteServiceToken = () => {
const queryClient = useQueryClient();
return useMutation<DeleteServiceTokenRes, {}, string>({
return useMutation<DeleteServiceTokenRes, object, string>({
mutationFn: async (serviceTokenId) => {
const { data } = await apiRequest.delete(`/api/v2/service-token/${serviceTokenId}`);
return data;
},
onSuccess: ({ serviceTokenData: { projectId } }) => {
queryClient.invalidateQueries(serviceTokenKeys.getAllWorkspaceServiceToken(projectId));
queryClient.invalidateQueries({
queryKey: serviceTokenKeys.getAllWorkspaceServiceToken(projectId)
});
}
});
};