feat(editor): ✨ Add cc & bcc + Deletable credentials
This commit is contained in:
@ -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',
|
||||
})
|
||||
|
Reference in New Issue
Block a user