mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-01-03 08:25:06 +03:00
Removed API versioning from webhooks
refs: https://github.com/TryGhost/Toolbox/issues/229 refs: https://github.com/TryGhost/Toolbox/issues/283 - we are getting rid of the concept of having multiple api versions in a single ghost install - we'll update webhooks to return a content version - we're also looking into if we need some sort of accept-version type logic
This commit is contained in:
parent
923d436f11
commit
1fbb8a219f
@ -1,9 +1,7 @@
|
||||
module.exports = (event, model) => {
|
||||
const _ = require('lodash');
|
||||
const {sequence} = require('@tryghost/promise');
|
||||
const api = require('../../api');
|
||||
|
||||
const apiVersion = model.get('api_version') || 'v4';
|
||||
const api = require('../../api').canary;
|
||||
|
||||
const resourceName = event.match(/(\w+)\./)[1];
|
||||
const docName = `${resourceName}s`;
|
||||
@ -22,7 +20,7 @@ module.exports = (event, model) => {
|
||||
return api.shared
|
||||
.serializers
|
||||
.handle
|
||||
.output(model, {docName: docName, method: 'read'}, api[apiVersion].serializers.output, frame)
|
||||
.output(model, {docName: docName, method: 'read'}, api.serializers.output, frame)
|
||||
.then(() => {
|
||||
return frame.response[docName][0];
|
||||
});
|
||||
@ -45,7 +43,7 @@ module.exports = (event, model) => {
|
||||
return api.shared
|
||||
.serializers
|
||||
.handle
|
||||
.output(model, {docName: docName, method: 'read'}, api[apiVersion].serializers.output, frame)
|
||||
.output(model, {docName: docName, method: 'read'}, api.serializers.output, frame)
|
||||
.then(() => {
|
||||
return frame.response[docName][0];
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user