mattermost-mobile/app/client/rest/custom_profile_attributes.ts
Mattermost Build 0b3596719a
View custom profile attributes (#8460) (#8475)
* feat: Add custom attributes section to user profile

(cherry picked from commit fff6788e94)

Co-authored-by: Guillermo Vayá <guillermo.vaya@mattermost.com>
2025-01-14 10:30:49 +02:00

27 lines
938 B
TypeScript

// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
import type ClientBase from './base';
export interface ClientCustomAttributesMix {
getCustomProfileAttributeFields: () => Promise<CustomProfileField[]>;
getCustomProfileAttributeValues: (userID: string) => Promise<CustomProfileAttributeSimple>;
}
const ClientCustomAttributes = <TBase extends Constructor<ClientBase>>(superclass: TBase) => class extends superclass {
getCustomProfileAttributeFields = async () => {
return this.doFetch(
`${this.getCustomProfileAttributesRoute()}/fields`,
{method: 'get'},
);
};
getCustomProfileAttributeValues = async (userID: string) => {
return this.doFetch(
`${this.getUserRoute(userID)}/custom_profile_attributes`,
{method: 'get'},
);
};
};
export default ClientCustomAttributes;