2
0

feat(editor): Add cc & bcc + Deletable credentials

This commit is contained in:
Baptiste Arnaud
2022-02-19 10:58:56 +01:00
parent c5972ec91b
commit b89e9b1b82
12 changed files with 210 additions and 38 deletions

View File

@ -16,7 +16,7 @@ export const useCredentials = ({
)
if (error) onError(error)
return {
credentials: data?.credentials,
credentials: data?.credentials ?? [],
isLoading: !error && !data,
mutate,
}
@ -33,3 +33,14 @@ export const createCredentials = async (
method: 'POST',
body: credentials,
})
export const deleteCredentials = async (
userId: string,
credentialsId: string
) =>
sendRequest<{
credentials: Credentials
}>({
url: `/api/users/${userId}/credentials/${credentialsId}`,
method: 'DELETE',
})