Add clear search history API (#26)

* Add clear search history API

* changelog
This commit is contained in:
Brahim Hadriche authored and GitHub committed 2022-12-06 17:04:30 -05:00
1 parent aa6cc6eb54
commit f71c70d90b
3 files changed
+19

No files matched your search

+3
View File
@@ -5,6 +5,9 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [Unreleased]
### Added
- Ability to clear search history from web app
### Changed
- The License has changed from MIT to AGPL
@@ -27,6 +27,10 @@ namespace Http
server.task.top.command = `play:${videoId}`
response.Default(204, "OK")
return true
else if payload.command = "clear-search-history"
RegistryUtils.Delete("search_history")
response.Default(204, "OK")
return true
end if
response.Default(400, `Invalid command: ${payload.command}`)
+12
View File
@@ -57,6 +57,8 @@
</table>
</br>
<button style="display: none" id="update-instances" onclick="UpdateInstances()">Update Instances</button>
</br>
<button onclick="ClearSearchHistory()">Clear Search History</button>
<h5>Instructions</h5>
<ul>
@@ -106,6 +108,16 @@
});
}
function ClearSearchHistory() {
PostJson('/api/command', { command: "clear-search-history" })
.then(function (response) {
alert("Search history cleared");
})
.catch(function (err) {
alert(err)
});
}
function CreateGithubIssueUrl() {
title = "[Feedback] Playlet"
body = `### Feedback