Removed unused frontend offer endpoint (#14816)

refs https://github.com/TryGhost/Team/issues/1599

- portal now uses offer content api to read offer details from id
This commit is contained in:
Rishabh Garg 2022-05-13 17:20:09 +05:30 committed by GitHub
parent 0f01aa6eea
commit 96bb441fb3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 11 deletions

View File

@ -2,7 +2,6 @@ const _ = require('lodash');
const logging = require('@tryghost/logging');
const membersService = require('./service');
const models = require('../../models');
const offersService = require('../offers/service');
const urlUtils = require('../../../shared/url-utils');
const {formattedMemberResponse} = require('./utils');
@ -56,14 +55,6 @@ const getMemberData = async function (req, res) {
}
};
const getOfferData = async function (req, res) {
const offerId = req.params.id;
const offer = await offersService.api.getOffer({id: offerId});
return res.json({
offers: [offer]
});
};
const getMemberNewsletters = async function (req, res) {
try {
const memberUuid = req.query.uuid;
@ -210,7 +201,6 @@ module.exports = {
getIdentityToken,
getMemberNewsletters,
getMemberData,
getOfferData,
updateMemberData,
updateMemberNewsletters,
deleteSession

View File

@ -38,11 +38,13 @@ module.exports = function setupMembersApp() {
membersApp.get('/api/member/newsletters', middleware.getMemberNewsletters);
membersApp.put('/api/member/newsletters', bodyParser.json({limit: '1mb'}), middleware.updateMemberNewsletters);
// Get and update member data
membersApp.get('/api/member', middleware.getMemberData);
membersApp.put('/api/member', bodyParser.json({limit: '1mb'}), middleware.updateMemberData);
membersApp.post('/api/member/email', bodyParser.json({limit: '1mb'}), (req, res) => membersService.api.middleware.updateEmailAddress(req, res));
// Manage session
membersApp.get('/api/session', middleware.getIdentityToken);
membersApp.get('/api/offers/:id', middleware.getOfferData);
membersApp.delete('/api/session', middleware.deleteSession);
// NOTE: this is wrapped in a function to ensure we always go via the getter