mirror of
https://codeberg.org/MarkusThielker/next-ory.git
synced 2025-04-10 11:58:41 +00:00
NORY-47: add action to delete identity credential
This commit is contained in:
parent
88115d143e
commit
e83041f8ac
1 changed files with 18 additions and 1 deletions
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
import { getIdentityApi } from '@/ory/sdk/server';
|
import { getIdentityApi } from '@/ory/sdk/server';
|
||||||
import { revalidatePath } from 'next/cache';
|
import { revalidatePath } from 'next/cache';
|
||||||
import { UpdateIdentityBody } from '@ory/client/api';
|
import { DeleteIdentityCredentialsTypeEnum, UpdateIdentityBody } from '@ory/client';
|
||||||
|
|
||||||
interface UpdatedIdentityProps {
|
interface UpdatedIdentityProps {
|
||||||
id: string;
|
id: string;
|
||||||
|
@ -17,6 +17,23 @@ export async function updateIdentity({ id, body }: UpdatedIdentityProps) {
|
||||||
updateIdentityBody: body,
|
updateIdentityBody: body,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
console.log('Updated identity', data);
|
||||||
|
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
|
||||||
|
interface DeleteIdentityCredentialProps {
|
||||||
|
id: string;
|
||||||
|
type: DeleteIdentityCredentialsTypeEnum;
|
||||||
|
}
|
||||||
|
|
||||||
|
export async function deleteIdentityCredential({ id, type }: DeleteIdentityCredentialProps) {
|
||||||
|
|
||||||
|
const identityApi = await getIdentityApi();
|
||||||
|
const { data } = await identityApi.deleteIdentityCredentials({ id, type });
|
||||||
|
|
||||||
|
console.log('Credential removed', data);
|
||||||
|
|
||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue