فهرست منبع

Merge pull request #5531 from overleaf/jel-web-unused-metrics-code

[web] Remove unused metrics code

GitOrigin-RevId: ffad327c02ebecfe47c4a063b8e694e5a18e3257
Timothée Alby 4 سال پیش
والد
کامیت
47cd2d7324

+ 0 - 24
services/web/app/src/Features/Institutions/InstitutionsAPI.js

@@ -45,30 +45,6 @@ const InstitutionsAPI = {
     )
   },
 
-  getInstitutionLicences(institutionId, startDate, endDate, lag, callback) {
-    makeAffiliationRequest(
-      {
-        method: 'GET',
-        path: `/api/v2/institutions/${institutionId.toString()}/institution_licences`,
-        body: { start_date: startDate, end_date: endDate, lag },
-        defaultErrorMessage: "Couldn't get institution licences",
-      },
-      callback
-    )
-  },
-
-  getInstitutionNewLicences(institutionId, startDate, endDate, lag, callback) {
-    makeAffiliationRequest(
-      {
-        method: 'GET',
-        path: `/api/v2/institutions/${institutionId.toString()}/new_institution_licences`,
-        body: { start_date: startDate, end_date: endDate, lag },
-        defaultErrorMessage: "Couldn't get institution new licences",
-      },
-      callback
-    )
-  },
-
   getUserAffiliations(userId, callback) {
     makeAffiliationRequest(
       {

+ 0 - 32
services/web/test/unit/src/Institutions/InstitutionsAPITests.js

@@ -74,38 +74,6 @@ describe('InstitutionsAPI', function () {
     })
   })
 
-  describe('getInstitutionLicences', function () {
-    it('get licences', function (done) {
-      this.institutionId = 123
-      const responseBody = {
-        lag: 'monthly',
-        data: [{ key: 'users', values: [{ x: '2018-01-01', y: 1 }] }],
-      }
-      this.request.yields(null, { statusCode: 200 }, responseBody)
-      const startDate = '1417392000'
-      const endDate = '1420848000'
-      this.InstitutionsAPI.getInstitutionLicences(
-        this.institutionId,
-        startDate,
-        endDate,
-        'monthly',
-        (err, body) => {
-          expect(err).not.to.exist
-          this.request.calledOnce.should.equal(true)
-          const requestOptions = this.request.lastCall.args[0]
-          const expectedUrl = `v1.url/api/v2/institutions/${this.institutionId}/institution_licences`
-          requestOptions.url.should.equal(expectedUrl)
-          requestOptions.method.should.equal('GET')
-          requestOptions.body.start_date.should.equal(startDate)
-          requestOptions.body.end_date.should.equal(endDate)
-          requestOptions.body.lag.should.equal('monthly')
-          body.should.equal(responseBody)
-          done()
-        }
-      )
-    })
-  })
-
   describe('getLicencesForAnalytics', function () {
     const lag = 'daily'
     const queryDate = '2017-01-07:00:00.000Z'