profile to users

This commit is contained in:
Inga Kirschnick
2022-12-23 18:08:33 +01:00
parent 30739f9111
commit 647969ef0e
12 changed files with 147 additions and 157 deletions

View File

@ -47,7 +47,7 @@ class PublicUserList extends RessourceList {
return {
'id': user.id,
'member-since': user.member_since,
'avatar': user.avatar ? `/profile/${user.id}/avatar` : '/static/images/user_avatar.png',
'avatar': user.avatar ? `/users/${user.id}/avatar` : '/static/images/user_avatar.png',
'username': user.username,
'full-name': user.full_name ? user.full_name : '',
'location': user.location ? user.location : '',
@ -83,7 +83,7 @@ class PublicUserList extends RessourceList {
let publicUserId = publicUserElement.dataset.id;
switch (action) {
case 'view': {
window.location.href = `/profile/${publicUserId}`;
window.location.href = `/users/${publicUserId}`;
break;
}
default: {

View File

@ -257,7 +257,7 @@ class Utils {
let confirmElement = modalElement.querySelector('.action-button[data-action="confirm"]');
confirmElement.addEventListener('click', (event) => {
fetch(`/profile/${userId}/avatar`, {method: 'DELETE', headers: {Accept: 'application/json'}})
fetch(`/users/${userId}/avatar`, {method: 'DELETE', headers: {Accept: 'application/json'}})
.then(
(response) => {
if (response.status === 403) {app.flash('Forbidden', 'error'); reject(response);}