Skip to content

Commit

Permalink
abstract roles being plural and an array, for our purpose it should j…
Browse files Browse the repository at this point in the history
…ust be a string
  • Loading branch information
ashfame committed Sep 25, 2024
1 parent ebb4084 commit 269ea81
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/api/ApiClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export interface CreateUserBody {
username: string;
email: string;
password: string;
roles?: [ string ]; // default roles: administrator, editor, author, subscriber (default)
role?: string; // default roles: administrator, editor, author, subscriber (default)
firstname?: string;
lastname?: string;
}
Expand Down Expand Up @@ -83,8 +83,8 @@ export class ApiClient {
email: body.email,
password: body.password,
};
if ( body.roles ) {
actualBody.roles = body.roles;
if ( body.role ) {
actualBody.roles = [ body.role ];
}
if ( body.firstname ) {
actualBody.first_name = body.firstname;
Expand Down

0 comments on commit 269ea81

Please sign in to comment.