-
-
Notifications
You must be signed in to change notification settings - Fork 658
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: import service validate duplicates #4558
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
1 Ignored Deployment
|
@@ -144,6 +145,7 @@ export default class ExportImportService { | |||
async validate( | |||
dto: ImportTogglesSchema, | |||
user: User, | |||
mode = 'regular' as Mode, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
enterprise can pass change-request mode
unsupportedStrategies, | ||
unsupportedContextFields || [], | ||
[], | ||
const errors = ImportValidationMessages.compileErrors({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
introduced object to make it more manageable
await this.createOrUpdateToggles(cleanedDto, user); | ||
} | ||
|
||
async importToggleLevelInfo( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
used by enterprise
async import(dto: ImportTogglesSchema, user: User): Promise<void> { | ||
const cleanedDto = await this.cleanData(dto); | ||
|
||
async importVerify( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
used by enterprise
@@ -46,35 +59,28 @@ export class ImportValidationMessages { | |||
), | |||
}); | |||
} | |||
if (segments.length > 0) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
moved to enterprise
}); | ||
} | ||
if (changeRequestExists) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
moved to enterprise
About the changes
Validate if we have duplicate feature in import.
Also preparing for duplication removal in the enterprise service by extracting shared methods.
Important files
Discussion points