Begin switch to gorilla/mux
I'm realizing with this code that I'm going to have a problem if I want to do HATEOAS-style APIs. chi just doesn't do resource-oriented API design, and I'd have to build a lot of stuff myself. I'm in the middle of swapping out the UI. Now is the time to make the switch.
This commit is contained in:
parent
c253e655b1
commit
5172400803
4 changed files with 53 additions and 6 deletions
|
|
@ -362,11 +362,12 @@ const saveChanges = async () => {
|
|||
console.error("Failed to upload avatar", error);
|
||||
}
|
||||
}
|
||||
const url = session.urls?.api.user;
|
||||
if (!url) {
|
||||
console.log("empty avatar url");
|
||||
const u = user.value;
|
||||
if (!u) {
|
||||
console.log("empty user");
|
||||
return;
|
||||
}
|
||||
const url = "/api" + u.uri;
|
||||
const response = await fetch(url, {
|
||||
method: "PUT",
|
||||
headers: {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue