Adds ability to rename favorite

This commit is contained in:
2025-03-05 00:10:23 -08:00
parent 0a86dbed49
commit 2b533cf1db
6 changed files with 187 additions and 20 deletions

View File

@@ -158,5 +158,15 @@ export const API = {
async clearFavorites(): Promise<void> {
await fetch('/api/favorites', { method: 'DELETE' });
},
async updateFavoriteTitle(filename: string, title: string): Promise<void> {
await fetch(`/api/favorites/${encodeURIComponent(filename)}/title`, {
method: 'PUT',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify({ title }),
});
}
};