fix(core): update

This commit is contained in:
2021-01-22 20:46:26 +00:00
parent 9d8c14d187
commit 9e338354c6
7 changed files with 44 additions and 31 deletions

View File

@@ -78,14 +78,14 @@ export class CloudflareWorker {
const requestRoute = `/zones/${zoneId}/workers/routes`;
await this.workerManager.cfAccount.request('POST', requestRoute, {
pattern: newRoute.pattern,
script: this.id
script: this.id,
});
} else if (routeStatus === 'needsUpdate') {
const zoneId = await this.workerManager.cfAccount.convenience.getZoneId(newRoute.zoneName);
const requestRoute = `/zones/${zoneId}/workers/routes/${routeIdForUpdate}`;
await this.workerManager.cfAccount.request('PUT', requestRoute, {
pattern: newRoute.pattern,
script: this.id
script: this.id,
});
}
}