Add recommend gql api

This commit is contained in:
Hongbo Wu
2022-12-02 19:45:26 +08:00
parent 0e3d1ced46
commit 7707f100f2
10 changed files with 207 additions and 15 deletions

View File

@ -10,7 +10,7 @@ import { nanoid } from 'nanoid'
import { google } from '@google-cloud/tasks/build/protos/protos'
import { IntegrationType } from '../entity/integration'
import { signFeatureToken } from '../services/features'
import { Group } from '../elastic/types'
import { Recommendation } from '../elastic/types'
import View = google.cloud.tasks.v2.Task.View
const logger = buildLogger('app.dispatch')
@ -409,13 +409,13 @@ export const enqueueTextToSpeech = async ({
export const enqueueRecommendation = async (
userId: string,
pageId: string,
group: Group
recommendation: Recommendation
): Promise<string> => {
const { GOOGLE_CLOUD_PROJECT } = process.env
const payload = {
userId,
pageId,
group,
recommendation,
}
// If there is no Google Cloud Project Id exposed, it means that we are in local environment