Use POST for search history
This commit is contained in:
1 parent
d9b8aaa222
commit
e0cf59d90f
5 files changed
+6
-7
No files matched your search
@@ -111,8 +111,8 @@ export class PlayletApi {
|
||||
return await response.json();
|
||||
}
|
||||
|
||||
static async putSearchHistory(query: string) {
|
||||
const response = await PlayletApi.putJson(`${PlayletApi.host()}/api/search-history`, { query });
|
||||
static async addSearchHistory(query: string) {
|
||||
const response = await PlayletApi.postJson(`${PlayletApi.host()}/api/search-history`, { query });
|
||||
return await response.json();
|
||||
}
|
||||
|
||||
|
||||
@@ -104,7 +104,7 @@
|
||||
}
|
||||
|
||||
if (page === 1) {
|
||||
const newSearchHistory = await PlayletApi.putSearchHistory(searchBoxText);
|
||||
const newSearchHistory = await PlayletApi.addSearchHistory(searchBoxText);
|
||||
searchHistoryStore.set(newSearchHistory);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user