From bd67677f549ee802bfa6f727967af7210478773a Mon Sep 17 00:00:00 2001 From: Christian Capeans Date: Thu, 6 Jul 2023 16:52:44 +0200 Subject: [PATCH] Delete merge presence in data transfer strategies --- .../local-destination/__tests__/index.test.ts | 27 +------------------ .../providers/local-destination/index.ts | 2 +- 2 files changed, 2 insertions(+), 27 deletions(-) diff --git a/packages/core/data-transfer/src/strapi/providers/local-destination/__tests__/index.test.ts b/packages/core/data-transfer/src/strapi/providers/local-destination/__tests__/index.test.ts index 0877869e3e..62e5b68d8d 100644 --- a/packages/core/data-transfer/src/strapi/providers/local-destination/__tests__/index.test.ts +++ b/packages/core/data-transfer/src/strapi/providers/local-destination/__tests__/index.test.ts @@ -51,7 +51,7 @@ describe('Local Strapi Source Destination', () => { }); describe('Strategy', () => { - test('requires strategy to be either restore or merge', async () => { + test('requires strategy to be restore', async () => { const restoreProvider = createLocalStrapiDestinationProvider({ getStrapi: getStrapiFactory({ db: { transaction }, @@ -61,15 +61,6 @@ describe('Local Strapi Source Destination', () => { await restoreProvider.bootstrap(); expect(restoreProvider.strapi).toBeDefined(); - const mergeProvider = createLocalStrapiDestinationProvider({ - getStrapi: getStrapiFactory({ - db: { transaction }, - }), - strategy: 'merge', - }); - await mergeProvider.bootstrap(); - expect(mergeProvider.strapi).toBeDefined(); - await expect( (async () => { const invalidProvider = createLocalStrapiDestinationProvider({ @@ -153,21 +144,5 @@ describe('Local Strapi Source Destination', () => { expect(deleteAllSpy).toBeCalledTimes(1); }); - - test('Should not delete if it is a merge strategy', async () => { - const provider = createLocalStrapiDestinationProvider({ - getStrapi: getStrapiFactory({ - db: { - transaction, - }, - }), - strategy: 'merge', - }); - const deleteAllSpy = jest.spyOn(restoreApi, 'deleteRecords'); - await provider.bootstrap(); - await provider.beforeTransfer(); - - expect(deleteAllSpy).not.toBeCalled(); - }); }); }); diff --git a/packages/core/data-transfer/src/strapi/providers/local-destination/index.ts b/packages/core/data-transfer/src/strapi/providers/local-destination/index.ts index 64f32de30c..80b13803c5 100644 --- a/packages/core/data-transfer/src/strapi/providers/local-destination/index.ts +++ b/packages/core/data-transfer/src/strapi/providers/local-destination/index.ts @@ -14,7 +14,7 @@ import * as utils from '../../../utils'; import { ProviderTransferError, ProviderValidationError } from '../../../errors/providers'; import { assertValidStrapi } from '../../../utils/providers'; -export const VALID_CONFLICT_STRATEGIES = ['restore', 'merge']; +export const VALID_CONFLICT_STRATEGIES = ['restore']; export const DEFAULT_CONFLICT_STRATEGY = 'restore'; export interface ILocalStrapiDestinationProviderOptions {