Select Git revision
changelog.md
Code owners
Assign users and groups as approvers for specific file changes. Learn more.
To find the state of this project's repository at the time of any of these versions, check out the tags.
contactchange-api.ts 1.29 KiB
const axios = require('axios');
import apiConnectionBasic from '../basic/api-connection-basic';
function getContactChangeApiUrl() {
return (
'https://' + apiConnectionBasic.getHostName() + '/coscine/api/Coscine.Api.User/ContactChange/'
);
}
export class ContactChangeApi {
public static getStatus(
thenHandler: any = apiConnectionBasic.defaultThenHandler,
catchHandler: any = apiConnectionBasic.defaultOnCatch
) {
apiConnectionBasic.setHeader();
return axios
.get(getContactChangeApiUrl() + 'status')
.then(thenHandler)
.catch(catchHandler);
}
public static confirm(
token: string,
thenHandler: any = apiConnectionBasic.defaultThenHandler,
catchHandler: any = apiConnectionBasic.defaultOnCatch
) {
return axios
.get(getContactChangeApiUrl() + 'confirm/' + token)
.then(thenHandler)
.catch(catchHandler);
}
public static emailChange(
body: any,
thenHandler: any = apiConnectionBasic.defaultThenHandler,
catchHandler: any = apiConnectionBasic.defaultOnCatch
) {
apiConnectionBasic.setHeader();
const config = { headers: {'Content-Type': 'application/json'} };
return axios
.post(getContactChangeApiUrl() + 'emailchange', body, config)
.then(thenHandler)
.catch(catchHandler);
}
}