From 5eeec240691f95a306ce0ac2170508d18a6a73d2 Mon Sep 17 00:00:00 2001 From: Adam R Grey Date: Sat, 6 Jul 2024 16:00:18 -0400 Subject: [PATCH] slightly more generic Patch function for API untested. you know, since... offline ;) --- WebInterface/Views/Channels/Details.cshtml | 4 ++-- wwwroot/js/site.js | 12 ++++++------ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/WebInterface/Views/Channels/Details.cshtml b/WebInterface/Views/Channels/Details.cshtml index ab338a8..e2e1054 100644 --- a/WebInterface/Views/Channels/Details.cshtml +++ b/WebInterface/Views/Channels/Details.cshtml @@ -23,7 +23,7 @@ Lewdness Filter Level - ⤵ inherited - @Enumerations.GetDescription(IfInheritedLewdnessFilterLevel) @foreach (Enumerations.LewdnessFilterLevel enumVal in Enum.GetValues(typeof(Enumerations.LewdnessFilterLevel))) @@ -53,7 +53,7 @@ Meanness Filter Level - ⤵ inherited - @Enumerations.GetDescription(IfInheritedMeannessFilterLevel) @foreach (Enumerations.MeannessFilterLevel enumVal in Enum.GetValues(typeof(Enumerations.MeannessFilterLevel))) diff --git a/wwwroot/js/site.js b/wwwroot/js/site.js index ec49115..8bc0b3a 100644 --- a/wwwroot/js/site.js +++ b/wwwroot/js/site.js @@ -7,7 +7,10 @@ function testfunct(caller){ console.log("[gibberish]"); console.log(caller); } -function patchModel(model) +//todo: figure out what the URL actually needs to be, rather than assuming you get a whole-ass server to yourself. +//you selfish fuck... What are you, fox? +//as it stands, you want something like /api/Channels/, trailing slash intentional +function patchModel(model, apiUrl) { //structure the model your (dang) self into a nice object console.log(model); @@ -16,15 +19,12 @@ function patchModel(model) var components = window.location.pathname.split('/'); if(components[2] !== "Details") { - console.log("wtf are you doing? " + components[2] + " is something other than Details") + console.log("wtf are you doing? " + components[2] + " is something other than Details"); + //add different endpoings here, if you like } var type=components[1]; var id=components[3]; - //todo: figure out what the URL actually needs to be, rather than assuming you get a whole-ass server to yourself. - //you selfish fuck. What are you, fox? - var apiUrl = "/api/Channels/" - console.log("dexter impression: I am now ready to post the following content:"); console.log(JSON.stringify(model)); fetch(apiUrl, {