Skip to content

[PB-6608] feat/add favorites support for files and folders#418

Open
victor-ferro wants to merge 1 commit into
masterfrom
PB-6608-add-favorites
Open

[PB-6608] feat/add favorites support for files and folders#418
victor-ferro wants to merge 1 commit into
masterfrom
PB-6608-add-favorites

Conversation

@victor-ferro

Copy link
Copy Markdown

Description

Adds SDK support for the new Favorites feature in the Drive API (drive-server-wip).

New methods in the Storage class:

Endpoint Method
PUT /files/{uuid}/favorite markFileAsFavorite(uuid)
DELETE /files/{uuid}/favorite unmarkFileAsFavorite(uuid)
GET /files/favorites getFavoriteFiles(payload) (cancellable)
PUT /folders/{uuid}/favorite markFolderAsFavorite(uuid)
DELETE /folders/{uuid}/favorite unmarkFolderAsFavorite(uuid)
GET /folders/favorites getFavoriteFolders(payload) (cancellable)

New types in drive/storage/types.ts: FavoriteStatusResponse, FavoriteFileDto,
FavoriteFolderDto, GetFavoriteFilesPayload, GetFavoriteFoldersPayload. The
paginated folder-content types and the hand-written item interfaces now expose an
optional isFavorite?: boolean returned by the backend.

Includes unit tests for all six methods following the existing request-shape pattern.

Notes

The backend PR adding isFavorite to the API is not deployed to production yet, so the
generated src/schema.ts does not include the field. This PR bridges that gap with
manual & { isFavorite?: boolean } intersections on the schema-derived types — safe to
ship before and after the backend deploy.

Once the backend is live in production, I have a follow-up PR already prepared that runs
yarn swagger (the production spec will then document isFavorite and the favorites
endpoints) and reverts those intersections to plain schema-derived aliases. Already
verified locally against the updated backend: types compile and tests pass without the
intersections.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant