Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: missing params on updateOwnBasicInfo endpoint #30156

Merged
merged 4 commits into from
Sep 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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