Files
bookhoard/bruno/ebooks/Create Ebook - No Library Error.bru
T
john-okeefe 66f1eb11a0 feat(ebooks): add ISBN normalization and graceful library requirement handling
- Increase ISBN column from VARCHAR(13) to VARCHAR(17) to support ISBN-13 with hyphens
- Add normalize_isbn() database function to automatically remove hyphens and spaces
- Create trigger to auto-normalize ISBNs on INSERT/UPDATE operations
- Update all Ebook and MediaItem queries to use ISBN normalization
- Add GetEbookLibraryID query to check for existing ebook libraries
- Add graceful error handling when no ebook library exists
- Return helpful error message: 'no ebook library found. Please create an ebook library first'
- Create comprehensive tests for ISBN normalization and library selection
- Add Bruno test files for various ISBN formats and error scenarios
- Update documentation with ISBN normalization details
2026-01-29 10:52:14 -05:00

47 lines
969 B
Plaintext

meta {
name: Create Ebook - No Library Error
type: http
seq: 11
}
post {
url: {{base_url}}/api/ebooks
body: json
auth: inherit
}
body:json {
{
"title": "Test Ebook",
"isbn": "9780123456789",
"description": "Testing error when no library exists",
"file_path": "/path/to/ebook.epub",
"file_size": 1048576,
"mime_type": "application/epub+zip"
}
}
settings {
encodeUrl: true
timeout: 0
}
docs {
## Create Ebook - No Library Error
**Expected Behavior:** Should return 400 Bad Request with error message: "no ebook library found. Please create an ebook library first"
This test demonstrates the graceful error handling when attempting to create an ebook without first creating an ebook library.
**Setup Required:**
- Ensure NO ebook library exists in the database
- Run as admin user
**Expected Response:**
```json
{
"error": "no ebook library found. Please create an ebook library first"
}
```
}