From f23f04e0b1d117be714bf91d5266dab219ed741e Mon Sep 17 00:00:00 2001
From: tobi <31960611+tsmethurst@users.noreply.github.com>
Date: Sat, 24 Aug 2024 11:49:37 +0200
Subject: [feature] Interaction requests client api + settings panel (#3215)

* [feature] Interaction requests client api + settings panel

* test accept / reject

* fmt

* don't pin rejected interaction

* use single db model for interaction accept, reject, and request

* swaggor

* env sharting

* append errors

* remove ErrNoEntries checks

* change intReqID to reqID

* rename "pend" to "request"

* markIntsPending -> mark interactionsPending

* use log instead of returning error when rejecting interaction

* empty migration

* jolly renaming

* make interactionURI unique again

* swag grr

* remove unnecessary locks

* invalidate as last step
---
 web/source/settings/views/user/router.tsx | 28 ++++++++++++++++++++++++++++
 1 file changed, 28 insertions(+)

(limited to 'web/source/settings/views/user/router.tsx')

diff --git a/web/source/settings/views/user/router.tsx b/web/source/settings/views/user/router.tsx
index 7b995b3b7..86bcf4243 100644
--- a/web/source/settings/views/user/router.tsx
+++ b/web/source/settings/views/user/router.tsx
@@ -26,6 +26,8 @@ import UserMigration from "./migration";
 import PostSettings from "./posts";
 import EmailPassword from "./emailpassword";
 import ExportImport from "./export-import";
+import InteractionRequests from "./interactions";
+import InteractionRequestDetail from "./interactions/detail";
 
 /**
  * - /settings/user/profile
@@ -33,6 +35,7 @@ import ExportImport from "./export-import";
  * - /settings/user/emailpassword
  * - /settings/user/migration
  * - /settings/user/export-import
+ * - /settings/users/interaction_requests
  */
 export default function UserRouter() {
 	const baseUrl = useBaseUrl();
@@ -52,6 +55,31 @@ export default function UserRouter() {
 						<Route><Redirect to="/profile" /></Route>
 					</Switch>
 				</ErrorBoundary>
+				<InteractionRequestsRouter />
+			</Router>
+		</BaseUrlContext.Provider>
+	);
+}
+
+/**
+ * - /settings/users/interaction_requests/search
+ * - /settings/users/interaction_requests/{reqId}
+ */
+function InteractionRequestsRouter() {
+	const parentUrl = useBaseUrl();
+	const thisBase = "/interaction_requests";
+	const absBase = parentUrl + thisBase;
+
+	return (
+		<BaseUrlContext.Provider value={absBase}>
+			<Router base={thisBase}>
+				<ErrorBoundary>
+					<Switch>
+						<Route path="/search" component={InteractionRequests} />
+						<Route path="/:reqId" component={InteractionRequestDetail} />
+						<Route><Redirect to="/search"/></Route>
+					</Switch>
+				</ErrorBoundary>
 			</Router>
 		</BaseUrlContext.Provider>
 	);
-- 
cgit v1.2.3

