feat(email): allow dismissing entity suggestions
All checks were successful
Build and Push Docker Images / build-backend (push) Successful in 45s
Build and Push Docker Images / build-frontend (push) Successful in 1m16s
Build and Push Docker Images / build-website (push) Successful in 23s
Build and Push Docker Images / build-central-services-api (push) Successful in 21s
Build and Push Docker Images / build-central-services-admin (push) Successful in 21s
Build and Push Docker Images / build-docs (push) Successful in 1m18s
All checks were successful
Build and Push Docker Images / build-backend (push) Successful in 45s
Build and Push Docker Images / build-frontend (push) Successful in 1m16s
Build and Push Docker Images / build-website (push) Successful in 23s
Build and Push Docker Images / build-central-services-api (push) Successful in 21s
Build and Push Docker Images / build-central-services-admin (push) Successful in 21s
Build and Push Docker Images / build-docs (push) Successful in 1m18s
This commit is contained in:
@@ -24,6 +24,16 @@ export const suggestionFormat = z.object({
|
||||
})
|
||||
export type EntitySuggestion = z.infer<typeof suggestionFormat>["suggestions"][number]
|
||||
|
||||
export function dismissEntitySuggestion(
|
||||
suggestions: EntitySuggestion[] | null | undefined,
|
||||
entityType: string,
|
||||
entityId: number,
|
||||
) {
|
||||
return (suggestions || []).filter(suggestion =>
|
||||
suggestion.entityType !== entityType || suggestion.entityId !== entityId,
|
||||
)
|
||||
}
|
||||
|
||||
// Only known, tenant-scoped candidates may become actionable suggestions.
|
||||
export function validateSuggestions(value: unknown, candidates: EntityCandidate[]) {
|
||||
const parsed = suggestionFormat.parse(value)
|
||||
|
||||
Reference in New Issue
Block a user