From f71c70d90b8529f908f4260bc7e26077c0410c6c Mon Sep 17 00:00:00 2001 From: Brahim Hadriche Date: Tue, 6 Dec 2022 17:04:30 -0500 Subject: [PATCH] Add clear search history API (#26) * Add clear search history API * changelog --- CHANGELOG.md | 3 +++ .../WebServer/Middleware/CommandsApiRouter.bs | 4 ++++ src/www/index.html | 12 ++++++++++++ 3 files changed, 19 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9294a9a2..8709a619 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/src/components/WebServer/Middleware/CommandsApiRouter.bs b/src/components/WebServer/Middleware/CommandsApiRouter.bs index 6ba380b1..55db536f 100644 --- a/src/components/WebServer/Middleware/CommandsApiRouter.bs +++ b/src/components/WebServer/Middleware/CommandsApiRouter.bs @@ -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}`) diff --git a/src/www/index.html b/src/www/index.html index 46096d65..770d9287 100644 --- a/src/www/index.html +++ b/src/www/index.html @@ -57,6 +57,8 @@
+
+
Instructions