Skip to content

Conversation

@Codencode
Copy link
Contributor

@Codencode Codencode commented Sep 26, 2025

Questions Answers
Description?
Type? improvement
BC breaks? no
Deprecations? no
Fixed ticket?
Sponsor company @Codencode
How to test?

How to test Category API

  • Create an API Client with these scopes : category_read & category_write
  • Request an access token

Query 1

  • Method : POST
  • URI : /category
  • Body :
{
  "names": {
    "en-US": "Category EN",
    "fr-FR": "Catégorie FR"
  },
  "linkRewrites": {
    "en-US": "category-en",
    "fr-FR": "categorie-fr"
  },
  "isActive": true,
  "parentCategoryId": 2,
  "shopIds": [1]
}
  • Response :
    • HTTP Code : 201
    • HTTP Body : Contains the ID of the created category (I will call it {theCreatedID})

Query 2

  • Method : GET
  • URI : /category/{theCreatedID}
  • Response :
    • HTTP Code : 200
    • HTTP Body : JSON of the created category

Query 3

  • Method : GET
  • URI : /categories?orderBy=categoryId&sortOrder=desc
  • Response :
    • HTTP Code : 200
    • HTTP Body : JSON list of categories, first item is {theCreatedID}

Query 4

  • Method : DELETE
  • URI : /category/{theCreatedID}
  • Body :
{"mode": "associate_and_disable"}
  • Response :
    • HTTP Code : 204

Query 5

  • Method : GET
  • URI : /category/{theCreatedID}
  • Response :
    • HTTP Code : 404

Query 6 (bulk toggle status)

  • Method : PUT
  • URI : /categories/toggle-status
  • Body :
{"categoryIds": [{theCreatedID2}, {theCreatedID3}], "enabled": false}
  • Response :

    • HTTP Code : 204
  • Check :

    • GET /category/{theCreatedID2} → enabled = false
    • GET /category/{theCreatedID3} → enabled = false

Query 7 (bulk delete)

  • Method : PUT
  • URI : /categories/delete
  • Body :
{"categoryIds": [{theCreatedID2}, {theCreatedID3}], "enabled": false, "mode": "associate_and_disable"}
  • Response :

    • HTTP Code : 204
  • Check :

    • GET /category/{theCreatedID2} → 404
    • GET /category/{theCreatedID3} → 404

@github-project-automation github-project-automation bot moved this to Ready for review in PR Dashboard Sep 26, 2025
@Codencode Codencode force-pushed the category-bulk-actions-endpoints branch 2 times, most recently from 341faeb to 781c506 Compare September 26, 2025 16:26
@Codencode Codencode changed the title Added category bulk actions endpoints Add endpoints for category bulk actions Sep 26, 2025
@Codencode Codencode force-pushed the category-bulk-actions-endpoints branch from 781c506 to 0efa790 Compare September 27, 2025 08:28
tleon
tleon previously approved these changes Sep 29, 2025
Copy link
Contributor

@tleon tleon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a little typo comment if you can fix it that would be great ;) Thx.

@ps-jarvis ps-jarvis added the Waiting for QA Status: Waiting for QA feedback label Sep 29, 2025
@ps-jarvis ps-jarvis moved this from Ready for review to To be tested in PR Dashboard Sep 29, 2025
@Codencode Codencode force-pushed the category-bulk-actions-endpoints branch from 0efa790 to fe82e27 Compare September 29, 2025 08:45
@Codencode
Copy link
Contributor Author

Just a little typo comment if you can fix it that would be great ;) Thx.

Done, thank you so much!!!

@Progi1984 Progi1984 removed the Waiting for QA Status: Waiting for QA feedback label Oct 1, 2025
@Codencode Codencode force-pushed the category-bulk-actions-endpoints branch from fe82e27 to 32e55c9 Compare October 15, 2025 07:29
@Codencode
Copy link
Contributor Author

@tleon I resolved a conflict with the tests/Integration/ApiPlatform/CategoryEndpointTest.php class, can you re-approve? Thanks 🙏

@Codencode Codencode requested a review from tleon October 15, 2025 07:35
@Codencode Codencode added the Waiting for QA Status: Waiting for QA feedback label Oct 22, 2025
@SiraDIOP SiraDIOP self-assigned this Oct 28, 2025
@SiraDIOP
Copy link

Hello @Codencode,

Thanks for your PR, i tested it and it's good for me :)

Query 1:
Capture d’écran 2025-10-28 à 11 06 32

Query 2:
Capture d’écran 2025-10-28 à 11 08 07

Query 3:
Capture d’écran 2025-10-28 à 11 09 37

Query 4:
Capture d’écran 2025-10-28 à 11 11 23

Query 5:
Capture d’écran 2025-10-28 à 11 12 14

Query 6:
Capture d’écran 2025-10-28 à 11 14 27

Capture d’écran 2025-10-28 à 11 15 07 Capture d’écran 2025-10-28 à 11 15 15

Query 7:
Capture d’écran 2025-10-28 à 11 16 48

Capture d’écran 2025-10-28 à 11 17 24 Capture d’écran 2025-10-28 à 11 17 15

Thanks ^^

@SiraDIOP SiraDIOP added QA ✔️ Status: QA-Approved and removed Waiting for QA Status: Waiting for QA feedback labels Oct 28, 2025
@Codencode Codencode added this to the 0.2.0 milestone Oct 28, 2025
@Codencode Codencode merged commit fa98c11 into PrestaShop:dev Oct 28, 2025
13 checks passed
@github-project-automation github-project-automation bot moved this from To be tested to Merged in PR Dashboard Oct 28, 2025
@Codencode Codencode deleted the category-bulk-actions-endpoints branch October 28, 2025 10:30
@nicosomb nicosomb mentioned this pull request Oct 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

Status: Merged

Development

Successfully merging this pull request may close these issues.

7 participants