mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-25 20:03:12 +03:00
Updated tenor API config keys and added contentfilter
support
refs https://github.com/TryGhost/Team/issues/1217 - tenor API config is now an object that lives at `config.tenor` - updated gifs card gating to use the new config object - added passthrough of `contentfilter` param from config when making Tenor API requests
This commit is contained in:
parent
8f6b1aa61a
commit
45fec25930
@ -26,7 +26,11 @@ export default class TenorService extends Service {
|
|||||||
_nextPos = null;
|
_nextPos = null;
|
||||||
|
|
||||||
get apiKey() {
|
get apiKey() {
|
||||||
return this.config.get('tenorApiKey');
|
return this.config.get('tenor.apiKey');
|
||||||
|
}
|
||||||
|
|
||||||
|
get contentfilter() {
|
||||||
|
return this.config.get('tenor.contentFilter') || 'off';
|
||||||
}
|
}
|
||||||
|
|
||||||
get isLoading() {
|
get isLoading() {
|
||||||
@ -131,7 +135,8 @@ export default class TenorService extends Service {
|
|||||||
const url = new URL(versionedPath, API_URL);
|
const url = new URL(versionedPath, API_URL);
|
||||||
|
|
||||||
const params = new URLSearchParams(options.params);
|
const params = new URLSearchParams(options.params);
|
||||||
params.append('key', this.apiKey);
|
params.set('key', this.apiKey);
|
||||||
|
params.set('contentfilter', this.contentfilter);
|
||||||
|
|
||||||
url.search = params.toString();
|
url.search = params.toString();
|
||||||
|
|
||||||
|
@ -224,7 +224,7 @@ export const CARD_MENU = [
|
|||||||
payload: {
|
payload: {
|
||||||
imageSelector: 'tenor'
|
imageSelector: 'tenor'
|
||||||
},
|
},
|
||||||
isAvailable: ['feature.gifsCard', 'config.tenorApiKey']
|
isAvailable: ['feature.gifsCard', 'config.tenor.apiKey']
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: 'Vimeo',
|
label: 'Vimeo',
|
||||||
|
Loading…
Reference in New Issue
Block a user