mirror of
https://github.com/n8n-io/n8n.git
synced 2024-12-24 20:24:05 -08:00
fix(core): Declutter webhook insertion errors (#10650)
Some checks are pending
Test Master / install-and-build (push) Waiting to run
Test Master / Unit tests (18.x) (push) Blocked by required conditions
Test Master / Unit tests (20.x) (push) Blocked by required conditions
Test Master / Unit tests (22.4) (push) Blocked by required conditions
Test Master / Lint (push) Blocked by required conditions
Test Master / Notify Slack on failure (push) Blocked by required conditions
Benchmark Docker Image CI / build (push) Waiting to run
Some checks are pending
Test Master / install-and-build (push) Waiting to run
Test Master / Unit tests (18.x) (push) Blocked by required conditions
Test Master / Unit tests (20.x) (push) Blocked by required conditions
Test Master / Unit tests (22.4) (push) Blocked by required conditions
Test Master / Lint (push) Blocked by required conditions
Test Master / Notify Slack on failure (push) Blocked by required conditions
Benchmark Docker Image CI / build (push) Waiting to run
This commit is contained in:
parent
2ea2bfe762
commit
36177b0943
|
@ -179,12 +179,12 @@ describe('WebhookService', () => {
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('createWebhook()', () => {
|
describe('createWebhook()', () => {
|
||||||
test('should create the webhook', async () => {
|
test('should store webhook in DB', async () => {
|
||||||
const mockWebhook = createWebhook('GET', 'user/:id');
|
const mockWebhook = createWebhook('GET', 'user/:id');
|
||||||
|
|
||||||
await webhookService.storeWebhook(mockWebhook);
|
await webhookService.storeWebhook(mockWebhook);
|
||||||
|
|
||||||
expect(webhookRepository.insert).toHaveBeenCalledWith(mockWebhook);
|
expect(webhookRepository.upsert).toHaveBeenCalledWith(mockWebhook, ['method', 'webhookPath']);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
@ -93,7 +93,7 @@ export class WebhookService {
|
||||||
async storeWebhook(webhook: WebhookEntity) {
|
async storeWebhook(webhook: WebhookEntity) {
|
||||||
void this.cacheService.set(webhook.cacheKey, webhook);
|
void this.cacheService.set(webhook.cacheKey, webhook);
|
||||||
|
|
||||||
return await this.webhookRepository.insert(webhook);
|
await this.webhookRepository.upsert(webhook, ['method', 'webhookPath']);
|
||||||
}
|
}
|
||||||
|
|
||||||
createWebhook(data: Partial<WebhookEntity>) {
|
createWebhook(data: Partial<WebhookEntity>) {
|
||||||
|
|
Loading…
Reference in a new issue