mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-20 11:22:15 +00:00
fix(core): Declutter webhook insertion errors (#10650)
This commit is contained in:
@@ -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>) {
|
||||||
|
|||||||
Reference in New Issue
Block a user