feat(web): introduce templates
This commit is contained in:
17
packages/web/src/hooks/useAdminUpdateTemplate.ee.js
Normal file
17
packages/web/src/hooks/useAdminUpdateTemplate.ee.js
Normal file
@@ -0,0 +1,17 @@
|
||||
import { useMutation } from '@tanstack/react-query';
|
||||
|
||||
import api from 'helpers/api';
|
||||
|
||||
export default function useAdminUpdateTemplate(templateId) {
|
||||
const mutation = useMutation({
|
||||
mutationFn: async ({ name }) => {
|
||||
const { data } = await api.patch(`/v1/admin/templates/${templateId}`, {
|
||||
name,
|
||||
});
|
||||
|
||||
return data;
|
||||
},
|
||||
});
|
||||
|
||||
return mutation;
|
||||
}
|
||||
Reference in New Issue
Block a user