Files
mattermost-mobile/app/client/rest/tos.ts
Daniel Espino García fe52fcaab6 Add terms of service (#6777)
* Add terms of service

* Add i18n

* Fix test

* Address feedback

* Address ux feedback

* Update texts

* Avoid Review to show on top of ToS

Co-authored-by: Daniel Espino <danielespino@MacBook-Pro-de-Daniel.local>
2022-11-24 19:58:56 +01:00

26 lines
838 B
TypeScript

// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
export interface ClientTosMix {
updateMyTermsOfServiceStatus: (termsOfServiceId: string, accepted: boolean) => Promise<{status: string}>;
getTermsOfService: () => Promise<TermsOfService>;
}
const ClientTos = (superclass: any) => class extends superclass {
updateMyTermsOfServiceStatus = async (termsOfServiceId: string, accepted: boolean) => {
return this.doFetch(
`${this.getUserRoute('me')}/terms_of_service`,
{method: 'post', body: {termsOfServiceId, accepted}},
);
};
getTermsOfService = async () => {
return this.doFetch(
`${this.urlVersion}/terms_of_service`,
{method: 'get'},
);
};
};
export default ClientTos;