Promote suggestion misses through the bulk-add modal, then delete them
Suggestion Misses' "Promote Selected" now opens the same bulk-add modal shape as Suggestions' "Create Many" (editable phrases textarea + lang/intent), prefilled with the selected misses' own text/language, and submits via batchCreateSuggestions() so edited/added lines are honored. Once that succeeds, the selected misses are deleted via the new batchDeleteSuggestionMisses() (DELETE /admin/suggestion-misses/batch) so they don't linger in the list now that they're suggestions. This is best-effort: a failed cleanup doesn't undo the promotion, just surfaces a separate warning notification.
This commit is contained in:
@@ -275,6 +275,15 @@ class BnfexpressAdminClient
|
||||
], fn (mixed $value): bool => $value !== null));
|
||||
}
|
||||
|
||||
/**
|
||||
* @param list<int|string> $missIds
|
||||
* @return array{deleted: int, skipped: int}
|
||||
*/
|
||||
public function batchDeleteSuggestionMisses(array $missIds): array
|
||||
{
|
||||
return $this->request('DELETE', '/admin/suggestion-misses/batch', body: ['miss_ids' => $missIds]);
|
||||
}
|
||||
|
||||
// --- Suggestion sync/embeddings ------------------------------------------
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user