Skip to content

Commit

Permalink
Fixed Metaverse user registration request format.
Browse files Browse the repository at this point in the history
  • Loading branch information
namark committed Apr 4, 2024
1 parent c98a20b commit 2f84163
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
8 changes: 5 additions & 3 deletions src/modules/account/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -182,9 +182,11 @@ export const Account = {
*/
async createAccount(pUsername: string, pPassword: string, pEmail: string): Promise<PostUsersResponse | false> {
const request = {
username: pUsername,
password: pPassword,
email: pEmail
user: {
username: pUsername,
password: pPassword,
email: pEmail
}
} as PostUsersRequest;
try {
const response = await API.post(API.endpoints.users, request) as PostUsersResponse;
Expand Down
8 changes: 5 additions & 3 deletions src/modules/metaverse/APIAccount.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,11 @@ export interface GetAccountByIdResponse {
// Create an account.
export const PostUsersAPI = "/api/v1/users";
export interface PostUsersRequest extends KeyedCollection {
"username": string,
"password": string,
"email": string
"user": {
"username": string,
"password": string,
"email": string
}
}
export interface PostUsersResponse {
"accountId": string,
Expand Down

0 comments on commit 2f84163

Please sign in to comment.