diff --git a/src/job/productionJobHandler.ts b/src/job/productionJobHandler.ts index a609dffb3..dc56593e0 100644 --- a/src/job/productionJobHandler.ts +++ b/src/job/productionJobHandler.ts @@ -140,36 +140,38 @@ export class ProductionJobHandler extends JobHandler { } } + // getPathPrefix(): string { + // try { + // const prefix = this.currJob.payload.urlSlug + // ? `${this.currJob.payload.urlSlug}/${this.currJob.payload.prefix}` + // : this.currJob.payload.prefix; + // if (this.currJob.payload.newHead && this.currJob.payload.action == 'automatedTest') { + // return `${prefix}/${this.currJob.payload.newHead}`; + // } + // return prefix; + // } catch (error) { + // this.logger.save(this.currJob._id, error).then(); + // throw new InvalidJobError(error.message); + // } + // } + getPathPrefix(): string { try { - const prefix = this.currJob.payload.urlSlug - ? `${this.currJob.payload.urlSlug}/${this.currJob.payload.prefix}` - : this.currJob.payload.prefix; - if (this.currJob.payload.newHead && this.currJob.payload.action == 'automatedTest') { - return `${prefix}/${this.currJob.payload.newHead}`; + if (this.currJob.payload.prefix && this.currJob.payload.prefix === '') { + return this.currJob.payload.urlSlug ?? ''; + } + if (this.currJob.payload.urlSlug) { + if (this.currJob.payload.urlSlug === '') { + return this.currJob.payload.prefix; + } else { + return `${this.currJob.payload.prefix}/${this.currJob.payload.urlSlug}`; + } } - return prefix; + return this.currJob.payload.prefix; } catch (error) { this.logger.save(this.currJob._id, error).then(); throw new InvalidJobError(error.message); } - // try { - // if (this.currJob.payload.prefix && this.currJob.payload.prefix === '') { - // return this.currJob.payload.urlSlug ?? ''; - // } - // if (this.currJob.payload.urlSlug) { - // if (this.currJob.payload.urlSlug === '') { - // return this.currJob.payload.prefix; - // } else { - // return this.currJob.payload.prefix + `/${this.currJob.payload.urlSlug}`; - // } - // } - - // return prefix; - // } catch (error) { - // this.logger.save(this.currJob._id, error).then(); - // throw new InvalidJobError(error.message); - // } } private async purgePublishedContent(makefileOutput: Array): Promise {