NORY-47: add action for updating an identity
This commit is contained in:
parent
c99618f737
commit
0485c224b0
1 changed files with 17 additions and 0 deletions
|
@ -2,11 +2,28 @@
|
||||||
|
|
||||||
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';
|
||||||
|
|
||||||
interface IdentityIdProps {
|
interface IdentityIdProps {
|
||||||
id: string;
|
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) {
|
export async function deleteIdentitySessions({ id }: IdentityIdProps) {
|
||||||
|
|
||||||
const identityApi = await getIdentityApi();
|
const identityApi = await getIdentityApi();
|
||||||
|
|
Loading…
Add table
Reference in a new issue