diff --git a/dashboard/src/app/(inside)/user/action.ts b/dashboard/src/app/(inside)/user/action.ts index 4c393cc..bd2ffbd 100644 --- a/dashboard/src/app/(inside)/user/action.ts +++ b/dashboard/src/app/(inside)/user/action.ts @@ -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();