[PR #4313] [MERGED] [API] add priority #6341

Closed
opened 2026-02-05 10:29:42 +03:00 by OVERLORD · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/BookStackApp/BookStack/pull/4313
Author: @rouet
Created: 6/15/2023
Status: Merged
Merged: 8/21/2023
Merged by: @ssddanbrown

Base: developmentHead: add-priority


📝 Commits (5)

  • 458cea3 [API] add priority in book read
  • bb3ce84 Merge branch 'BookStackApp:development' into add-priority
  • b1b8067 Merge branch 'BookStackApp:development' into add-priority
  • 4d399f6 add priority on page and chapter create
  • 3a36d3c add tests for priority

📊 Changes

11 files changed (+86 additions, -10 deletions)

View changed files

📝 app/Api/ApiEntityListFormatter.php (+1 -0)
📝 app/Entities/Controllers/ChapterApiController.php (+2 -0)
📝 app/Entities/Controllers/PageApiController.php (+2 -0)
📝 app/Entities/Repos/ChapterRepo.php (+1 -1)
📝 app/Entities/Repos/PageRepo.php (+1 -1)
📝 dev/api/requests/chapters-create.json (+4 -2)
📝 dev/api/requests/chapters-update.json (+3 -2)
📝 dev/api/requests/pages-create.json (+3 -2)
📝 dev/api/requests/pages-update.json (+3 -2)
📝 tests/Api/ChaptersApiTest.php (+32 -0)
📝 tests/Api/PagesApiTest.php (+34 -0)

📄 Description

[API] add priority in book read
[API] add priority in chapter create and update
[API] add priority in page create and update

I propose a pull request in order to add the possibility of modifying the priority field of pages and chapters by the api, this in order to allow sorting a book using the api.
This proposal solves the problem posed by @riton in ticket #4298.
I also added in addition to display the priorities when a book is requested by the rest api.
We have tested and validated it internally.
I am not a Laravel specialist, but if it is necessary to add the corresponding tests, I can do it, but it will need help on the scenarios to be tested.

Regards.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/BookStackApp/BookStack/pull/4313 **Author:** [@rouet](https://github.com/rouet) **Created:** 6/15/2023 **Status:** ✅ Merged **Merged:** 8/21/2023 **Merged by:** [@ssddanbrown](https://github.com/ssddanbrown) **Base:** `development` ← **Head:** `add-priority` --- ### 📝 Commits (5) - [`458cea3`](https://github.com/BookStackApp/BookStack/commit/458cea36449aeb037bc34b462ad135d426eed204) [API] add priority in book read - [`bb3ce84`](https://github.com/BookStackApp/BookStack/commit/bb3ce845b42ab5753d674860aee27825992b50e2) Merge branch 'BookStackApp:development' into add-priority - [`b1b8067`](https://github.com/BookStackApp/BookStack/commit/b1b8067cbe79d7ca2bca9021ab9d37465b0c44fe) Merge branch 'BookStackApp:development' into add-priority - [`4d399f6`](https://github.com/BookStackApp/BookStack/commit/4d399f6ba77610635d4d1399b9ac3d5302c63b9c) add priority on page and chapter create - [`3a36d3c`](https://github.com/BookStackApp/BookStack/commit/3a36d3c847d235da3926f80303715e5349ee449f) add tests for priority ### 📊 Changes **11 files changed** (+86 additions, -10 deletions) <details> <summary>View changed files</summary> 📝 `app/Api/ApiEntityListFormatter.php` (+1 -0) 📝 `app/Entities/Controllers/ChapterApiController.php` (+2 -0) 📝 `app/Entities/Controllers/PageApiController.php` (+2 -0) 📝 `app/Entities/Repos/ChapterRepo.php` (+1 -1) 📝 `app/Entities/Repos/PageRepo.php` (+1 -1) 📝 `dev/api/requests/chapters-create.json` (+4 -2) 📝 `dev/api/requests/chapters-update.json` (+3 -2) 📝 `dev/api/requests/pages-create.json` (+3 -2) 📝 `dev/api/requests/pages-update.json` (+3 -2) 📝 `tests/Api/ChaptersApiTest.php` (+32 -0) 📝 `tests/Api/PagesApiTest.php` (+34 -0) </details> ### 📄 Description [API] add priority in book read [API] add priority in chapter create and update [API] add priority in page create and update I propose a pull request in order to add the possibility of modifying the priority field of pages and chapters by the api, this in order to allow sorting a book using the api. This proposal solves the problem posed by @riton in ticket #4298. I also added in addition to display the priorities when a book is requested by the rest api. We have tested and validated it internally. I am not a Laravel specialist, but if it is necessary to add the corresponding tests, I can do it, but it will need help on the scenarios to be tested. Regards. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
OVERLORD added the pull-request label 2026-02-05 10:29:42 +03:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/BookStack#6341