mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-11-11 00:37:55 +03:00
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:
parent
0f01aa6eea
commit
96bb441fb3
@ -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
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user