Skip to content

Commit

Permalink
fix: missing params on updateOwnBasicInfo endpoint (#30156)
Browse files Browse the repository at this point in the history
  • Loading branch information
dougfabris authored Sep 12, 2023
1 parent afd2b0d commit 93d4912
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 13 deletions.
6 changes: 6 additions & 0 deletions .changeset/wise-walls-tan.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'@rocket.chat/rest-typings': minor
'@rocket.chat/meteor': minor
---

fix: missing params on updateOwnBasicInfo endpoint
2 changes: 2 additions & 0 deletions apps/meteor/app/api/server/v1/users.ts
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,9 @@ API.v1.addRoute(
realname: this.bodyParams.data.name,
username: this.bodyParams.data.username,
nickname: this.bodyParams.data.nickname,
bio: this.bodyParams.data.bio,
statusText: this.bodyParams.data.statusText,
statusType: this.bodyParams.data.statusType,
newPassword: this.bodyParams.data.newPassword,
typedPassword: this.bodyParams.data.currentPassword,
};
Expand Down
16 changes: 3 additions & 13 deletions packages/rest-typings/src/v1/users.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import type {
} from '@rocket.chat/core-typings';
import Ajv from 'ajv';

import type { UsersSendConfirmationEmailParamsPOST } from '..';
import type { PaginatedRequest } from '../helpers/PaginatedRequest';
import type { PaginatedResult } from '../helpers/PaginatedResult';
import type { UserCreateParamsPOST } from './users/UserCreateParamsPOST';
Expand All @@ -20,7 +19,9 @@ import type { UserSetActiveStatusParamsPOST } from './users/UserSetActiveStatusP
import type { UsersAutocompleteParamsGET } from './users/UsersAutocompleteParamsGET';
import type { UsersInfoParamsGet } from './users/UsersInfoParamsGet';
import type { UsersListTeamsParamsGET } from './users/UsersListTeamsParamsGET';
import type { UsersSendConfirmationEmailParamsPOST } from './users/UsersSendConfirmationEmailParamsPOST';
import type { UsersSetPreferencesParamsPOST } from './users/UsersSetPreferenceParamsPOST';
import type { UsersUpdateOwnBasicInfoParamsPOST } from './users/UsersUpdateOwnBasicInfoParamsPOST';
import type { UsersUpdateParamsPOST } from './users/UsersUpdateParamsPOST';

const ajv = new Ajv({
Expand Down Expand Up @@ -358,18 +359,7 @@ export type UsersEndpoints = {
};

'/v1/users.updateOwnBasicInfo': {
POST: (params: {
data: {
email?: string;
name?: string;
username?: string;
nickname?: string;
statusText?: string;
newPassword?: string;
currentPassword?: string;
};
customFields?: Record<string, unknown>;
}) => {
POST: (params: UsersUpdateOwnBasicInfoParamsPOST) => {
user: IUser;
};
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ export type UsersUpdateOwnBasicInfoParamsPOST = {
name?: string;
username?: string;
nickname?: string;
bio?: string;
statusText?: string;
statusType?: string;
currentPassword?: string;
newPassword?: string;
};
Expand Down Expand Up @@ -39,6 +41,14 @@ const UsersUpdateOwnBasicInfoParamsPostSchema = {
type: 'string',
nullable: true,
},
bio: {
type: 'string',
nullable: true,
},
statusType: {
type: 'string',
nullable: true,
},
statusText: {
type: 'string',
nullable: true,
Expand Down

0 comments on commit 93d4912

Please sign in to comment.