Renamed members import/export endpoints

refs cb26fd9305

- Reasoning behind the rename in referenced commit
This commit is contained in:
Nazar Gargol 2020-06-16 18:08:50 +12:00
parent 3c610a1aff
commit 5f00619d1a
3 changed files with 7 additions and 7 deletions

View File

@ -91,8 +91,8 @@ module.exports = function apiRoutes() {
router.get('/members/stats', shared.middlewares.labs.members, mw.authAdminApi, http(apiCanary.members.stats));
router.post('/members/upload/validate', shared.middlewares.labs.members, mw.authAdminApi, http(apiCanary.members.validateImport));
router.get('/members/csv', shared.middlewares.labs.members, mw.authAdminApi, http(apiCanary.members.exportCSV));
router.post('/members/csv',
router.get('/members/upload', shared.middlewares.labs.members, mw.authAdminApi, http(apiCanary.members.exportCSV));
router.post('/members/upload',
shared.middlewares.labs.members,
mw.authAdminApi,
apiMw.upload.single('membersfile'),

View File

@ -306,7 +306,7 @@ describe('Members API', function () {
it('Can export CSV', function () {
return request
.get(localUtils.API.getApiQuery(`members/csv/`))
.get(localUtils.API.getApiQuery(`members/upload/`))
.set('Origin', config.get('url'))
.expect('Content-Type', /text\/csv/)
.expect('Cache-Control', testUtils.cacheRules.private)
@ -322,7 +322,7 @@ describe('Members API', function () {
it('Can import CSV', function () {
return request
.post(localUtils.API.getApiQuery(`members/csv/`))
.post(localUtils.API.getApiQuery(`members/upload/`))
.attach('membersfile', path.join(__dirname, '/../../utils/fixtures/csv/valid-members-import.csv'))
.set('Origin', config.get('url'))
.expect('Content-Type', /json/)

View File

@ -138,7 +138,7 @@ describe('Members API', function () {
it('Can import CSV with minimum one field', function () {
return request
.post(localUtils.API.getApiQuery(`members/csv/`))
.post(localUtils.API.getApiQuery(`members/upload/`))
.field('labels', ['global-label-1', 'global-label-1'])
.attach('membersfile', path.join(__dirname, '/../../../../utils/fixtures/csv/valid-members-labels.csv'))
.set('Origin', config.get('url'))
@ -186,7 +186,7 @@ describe('Members API', function () {
it('Can import CSV with labels and provide additional labels', function () {
return request
.post(localUtils.API.getApiQuery(`members/csv/`))
.post(localUtils.API.getApiQuery(`members/upload/`))
.attach('membersfile', path.join(__dirname, '/../../../../utils/fixtures/csv/valid-members-defaults.csv'))
.set('Origin', config.get('url'))
@ -235,7 +235,7 @@ describe('Members API', function () {
it('Fails to import members with stripe_customer_id', function () {
return request
.post(localUtils.API.getApiQuery(`members/csv/`))
.post(localUtils.API.getApiQuery(`members/upload/`))
.attach('membersfile', path.join(__dirname, '/../../../../utils/fixtures/csv/members-with-stripe-ids.csv'))
.set('Origin', config.get('url'))
.expect('Content-Type', /json/)