Skip to content

Commit c0857c3

Browse files
authored
Add option to fail on conflict (#625)
related to descope/etc#13449
1 parent 520dc9e commit c0857c3

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

lib/management/user.ts

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -684,18 +684,30 @@ const withUser = (httpClient: HttpClient) => {
684684
loginId: string,
685685
email: string,
686686
isVerified: boolean,
687+
failOnConflict?: boolean,
687688
): Promise<SdkResponse<UserResponse>> =>
688689
transformResponse<SingleUserResponse, UserResponse>(
689-
httpClient.post(apiPaths.user.updateEmail, { loginId, email, verified: isVerified }),
690+
httpClient.post(apiPaths.user.updateEmail, {
691+
loginId,
692+
email,
693+
verified: isVerified,
694+
failOnConflict,
695+
}),
690696
(data) => data.user,
691697
),
692698
updatePhone: (
693699
loginId: string,
694700
phone: string,
695701
isVerified: boolean,
702+
failOnConflict?: boolean,
696703
): Promise<SdkResponse<UserResponse>> =>
697704
transformResponse<SingleUserResponse, UserResponse>(
698-
httpClient.post(apiPaths.user.updatePhone, { loginId, phone, verified: isVerified }),
705+
httpClient.post(apiPaths.user.updatePhone, {
706+
loginId,
707+
phone,
708+
verified: isVerified,
709+
failOnConflict,
710+
}),
699711
(data) => data.user,
700712
),
701713
updateDisplayName: (

0 commit comments

Comments
 (0)