Enforce unique catalog titles on creation
Added a uniqueness check for catalog titles in the creation flow. The service now prevents creating catalogs with duplicate titles by checking for existing entries before insertion. If a duplicate is detected, the API returns a 409 Conflict response. Updated interfaces and repository to support title-based lookups.
This commit is contained in:
@@ -6,6 +6,7 @@ public interface ICatalogRepository
|
||||
{
|
||||
Task<List<VwmyCatalog>> GetAllAsync(CancellationToken cancellationToken = default);
|
||||
Task<VwmyCatalog?> GetByIdAsync(int id, CancellationToken cancellationToken = default);
|
||||
Task<VwmyCatalog?> GetByTitleAsync(string title, CancellationToken cancellationToken = default);
|
||||
Task<VwmyCatalog> InsertAsync(VwmyCatalog catalog, CancellationToken cancellationToken = default);
|
||||
Task<VwmyCatalog?> UpdateAsync(int id, VwmyCatalog catalog, CancellationToken cancellationToken = default);
|
||||
Task<bool> DeleteAsync(int id, CancellationToken cancellationToken = default);
|
||||
|
||||
Reference in New Issue
Block a user