NORY-47: add action for updating an identity

This commit is contained in:
Markus Thielker 2024-12-29 00:33:09 +01:00
parent c99618f737
commit 0485c224b0
No known key found for this signature in database

View file

@ -2,11 +2,28 @@
import { getIdentityApi } from '@/ory/sdk/server';
import { revalidatePath } from 'next/cache';
import { UpdateIdentityBody } from '@ory/client/api';
interface IdentityIdProps {
id: string;
}
interface UpdatedIdentityProps {
id: string;
body: UpdateIdentityBody;
}
export async function updateIdentity({ id, body }: UpdatedIdentityProps) {
const identityApi = await getIdentityApi();
const { data } = await identityApi.updateIdentity({
id: id,
updateIdentityBody: body,
});
return data;
}
export async function deleteIdentitySessions({ id }: IdentityIdProps) {
const identityApi = await getIdentityApi();