Skip to content
Snippets Groups Projects
Select Git revision
  • df5f546b3321848583820a407112fe0e21b0750d
  • master default protected
  • gitkeep
  • dev protected
  • Sprint/2022-01
  • Sprint/2021-15
  • Product/1573-ReadOnlyResources
  • Topic/1594-SetReadOnlyResources
  • Sprint/2021-09
  • Product/1442-projectInviteMngmnt
  • Topic/1529-HandleExternalUserInvitation
  • Topic/1528-projectInviteAPIcon
  • Sprint/2021-07
  • Product/1440-largerFiles
  • Topic/1451-uploadUrl
  • Topic/1452-largerFiles
  • Sprint/2021-06
  • Product/917-maintenanceFunctionality
  • Topic/1297-maintenanceBanner
  • Sprint/2021-04
  • Product/789-userContactEmail
  • v1.31.0
  • v1.30.0
  • v1.29.0
  • v1.28.0
  • v1.27.0
  • v1.26.0
  • v1.25.0
  • v1.24.2
  • v1.24.1
  • v1.24.0
  • v1.23.1
  • v1.23.0
  • v1.22.0
  • v1.21.0
  • v1.20.0
  • v1.19.0
  • v1.18.1
  • v1.18.0
  • v1.17.1
  • v1.17.0
41 results

contactchange-api.ts

Blame
  • Marcel Nellesen's avatar
    Marcel Nellesen authored and Benedikt Heinrichs committed
    9542f87e
    History
    Code owners
    Assign users and groups as approvers for specific file changes. Learn more.
    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);
      }
    }