Chore: Migrate REST API - merge v1/user in v1/users (#3827)
This commit is contained in:
parent
4c490576fa
commit
c6824e7fcf
|
@ -11,7 +11,6 @@ import { PermissionsEndpoints } from './permissions';
|
|||
import { RolesEndpoints } from './roles';
|
||||
import { RoomsEndpoints } from './rooms';
|
||||
import { OauthCustomConfiguration } from './settings';
|
||||
import { UserEndpoints } from './user';
|
||||
import { UsersEndpoints } from './users';
|
||||
import { TeamsEndpoints } from './teams';
|
||||
import { E2eEndpoints } from './e2e';
|
||||
|
@ -30,7 +29,6 @@ export type Endpoints = ChannelsEndpoints &
|
|||
RolesEndpoints &
|
||||
RoomsEndpoints &
|
||||
OauthCustomConfiguration &
|
||||
UserEndpoints &
|
||||
UsersEndpoints &
|
||||
TeamsEndpoints &
|
||||
E2eEndpoints &
|
||||
|
|
|
@ -1,23 +0,0 @@
|
|||
import { INotificationPreferences, IUser, IUserPreferences, IUserRegistered } from '../../IUser';
|
||||
|
||||
export type UserEndpoints = {
|
||||
'users.info': {
|
||||
GET: (params: { userId: IUser['_id'] }) => {
|
||||
user: IUser;
|
||||
success: boolean;
|
||||
};
|
||||
POST: (params: { userId: IUser['_id'] }) => {
|
||||
user: IUser;
|
||||
success: boolean;
|
||||
};
|
||||
};
|
||||
'users.setPreferences': {
|
||||
POST: (params: { userId: IUser['_id']; data: Partial<INotificationPreferences> }) => {
|
||||
user: IUserPreferences;
|
||||
success: boolean;
|
||||
};
|
||||
};
|
||||
'users.register': {
|
||||
POST: (params: { name: string; email: string; username: string; pass: string }) => { user: IUserRegistered };
|
||||
};
|
||||
};
|
|
@ -1,5 +1,6 @@
|
|||
import type { ITeam } from '../../ITeam';
|
||||
import type { IUser } from '../../IUser';
|
||||
import { INotificationPreferences, IUserPreferences, IUserRegistered } from '../../IUser';
|
||||
|
||||
export type UsersEndpoints = {
|
||||
'users.2fa.sendEmailCode': {
|
||||
|
@ -11,4 +12,23 @@ export type UsersEndpoints = {
|
|||
'users.listTeams': {
|
||||
GET: (params: { userId: IUser['_id'] }) => { teams: Array<ITeam> };
|
||||
};
|
||||
'users.info': {
|
||||
GET: (params: { userId: IUser['_id'] }) => {
|
||||
user: IUser;
|
||||
success: boolean;
|
||||
};
|
||||
POST: (params: { userId: IUser['_id'] }) => {
|
||||
user: IUser;
|
||||
success: boolean;
|
||||
};
|
||||
};
|
||||
'users.setPreferences': {
|
||||
POST: (params: { userId: IUser['_id']; data: Partial<INotificationPreferences> }) => {
|
||||
user: IUserPreferences;
|
||||
success: boolean;
|
||||
};
|
||||
};
|
||||
'users.register': {
|
||||
POST: (params: { name: string; email: string; username: string; pass: string }) => { user: IUserRegistered };
|
||||
};
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue