mirror of
https://github.com/wassname/talk.git
synced 2026-09-12 13:01:11 +08:00
fix: resolved issue with incorrect moderation url being generated (#2743)
This commit is contained in:
@@ -61,7 +61,11 @@ export default class TenantContext extends CommonContext {
|
||||
this.clientID = options.clientID;
|
||||
this.publisher = createPublisher({
|
||||
pubsub: this.pubsub,
|
||||
slackPublisher: createSlackPublisher(this.mongo, this.tenant),
|
||||
slackPublisher: createSlackPublisher(
|
||||
this.mongo,
|
||||
this.config,
|
||||
this.tenant
|
||||
),
|
||||
notifierQueue,
|
||||
tenantID: this.tenant.id,
|
||||
clientID: this.clientID,
|
||||
|
||||
@@ -2,7 +2,7 @@ import { GraphQLResolveInfo } from "graphql";
|
||||
import graphqlFields from "graphql-fields";
|
||||
import { pull } from "lodash";
|
||||
|
||||
import { constructTenantURL, reconstructURL } from "coral-server/app/url";
|
||||
import { reconstructTenantURL } from "coral-server/app/url";
|
||||
|
||||
import TenantContext from "../context";
|
||||
|
||||
@@ -16,16 +16,6 @@ export function getRequestedFields<T>(info: GraphQLResolveInfo) {
|
||||
}
|
||||
|
||||
export function reconstructTenantURLResolver<T = any>(path: string) {
|
||||
return (parent: T, args: {}, ctx: TenantContext) => {
|
||||
// If the request is available, then prefer it over building from the tenant
|
||||
// as the tenant does not include the port number. This should only really
|
||||
// be a problem if the graph API is called internally.
|
||||
if (ctx.req) {
|
||||
return reconstructURL(ctx.req, path);
|
||||
}
|
||||
|
||||
// Note that when constructing the callback url with the tenant, the port
|
||||
// information is lost.
|
||||
return constructTenantURL(ctx.config, ctx.tenant, path);
|
||||
};
|
||||
return (parent: T, args: {}, ctx: TenantContext) =>
|
||||
reconstructTenantURL(ctx.config, ctx.tenant, ctx.req, path);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user