Commit Graph

8 Commits

Author SHA1 Message Date
Naz
fdd73d01b7
Refactored collections entity logic
refs https://github.com/TryGhost/Team/issues/3294

- The factory method for the Collection and validations should live close together based on our latest architectural direction
2023-05-24 17:01:28 +07:00
Naz
735edf5f87 Fixed editing unexistent collection behavior
refs https://github.com/TryGhost/Team/issues/3167

- When editing collection that does not exist the API should be returning a 404 instead of creating a new collection
2023-05-19 20:42:46 +07:00
Naz
7d926dd30b Refactored collections unit test suite
refs https://github.com/TryGhost/Team/issues/3167

- Duplicate service initialization was getting annoying
2023-05-19 20:42:46 +07:00
Naz
606bd383f1 Extended getAll method with paging metadata
refs https://github.com/TryGhost/Team/issues/3167

- Having paging metadata is part of every API response and was missing from initial implementation
- The getAll method has all of the values as "static" as there's nothing to page on.
2023-05-19 20:42:46 +07:00
Naz
2d1eb881fc Extended save method to return saved collection data
refs https://github.com/TryGhost/Team/issues/3167

- The core client (API) needs a way to pass in information without an ID when creating a new entity, handling it on service/repository layer makes the most sense.
- Used "require" syntax to import tpl/errors modules, otherwise TS compiler was complaining about type compatibility issues, this works as a temporary workaround and is tracked and an issue to improve in the future.
2023-05-19 20:42:46 +07:00
Naz
d4a5dac758 Exposed in-memory collections repository
refs https://github.com/TryGhost/Team/issues/3167

- The repository is needed when initializing the collections service from the core
2023-05-19 20:42:46 +07:00
Naz
2a16b1427d
Removed stray tsconfig.tsbuildinfo file
refs 69ce97268e

- This file should not have gotten into the source code from the get co
2023-05-16 13:08:57 +07:00
Naz
4e2a00b6e6 Added a collections package with CRUD logic
closes https://github.com/TryGhost/Team/issues/3166

- The collections service contains CRUD logic to manage collection entities through: save, getById, getAll, and destroy methods.
2023-05-16 12:21:31 +07:00