Commit Graph

5 Commits

Author SHA1 Message Date
Naz
2a7ef77a7b Added ability to delete existing files through storage adapters
refs https://github.com/TryGhost/Toolbox/issues/120

- When editing an uploaded media thumbnail  file there'a need to remove existing thumbnail to keep media files:thumbnails 1:1. - Because the API client only has a public URL under which the resource is served it can only provide that as an API input, the `urlToPath` was also added to the base class of LocalStorageAdapter (it might be moved up to the BaseAdapter in the future if we see a need)
2021-11-09 16:07:23 +04:00
Naz
ad2583530a Renamed getLocalFileStoragePath
refs https://github.com/TryGhost/Toolbox/issues/95

- getLocalImagesStoragePath makes a lot more sense in context of what the method really does
2021-11-05 17:17:18 +04:00
Naz
c802097b72 Renamed LocalFileStorage to LocalImages store
refs https://github.com/TryGhost/Toolbox/issues/95

- This naming corresponds way better to what the actual adapter does
2021-11-05 17:17:18 +04:00
Naz
393280b6ae Reworked LocalFileStore methods to use async syntax
refs https://linear.app/tryghost/issue/CORE-1/multiple-adapters-per-type

- While digging around this area refactored the code to use more readable async/await syntax instead of chaining then's
- Dropped unneeded "catch" block in save method as all it was doing was rethrowing an error with out additional handling
2021-10-20 10:29:46 +04:00
Hannah Wolfe
9e96b04542
Moved server unit tests into the server folder
- this is a small part of a bit of cleanup of our test files
- the goal is to make the existing tests clearer with a view to making it easier to write more tests
- this makes the test structure follow the codebase structure more closely
- eventually we will colocate the tests as we break the codebase down further
2021-10-06 12:01:09 +01:00