mirror of
https://github.com/mealie-recipes/mealie.git
synced 2025-07-23 15:19:41 +02:00
fix: Home Doesn't Load For Non-Admin Users (#2556)
* added non-admin route for fetching current group
* simplified frontend group slug fetching
* exposed public link even if user can't invite
* 🧹
This commit is contained in:
parent
15c6df88ab
commit
3e5596f898
6 changed files with 27 additions and 43 deletions
|
@ -1,7 +1,9 @@
|
|||
import { BaseCRUDAPI } from "../base/base-clients";
|
||||
import { RequestResponse } from "../types/non-generated";
|
||||
import {
|
||||
ChangePassword,
|
||||
DeleteTokenResponse,
|
||||
GroupInDB,
|
||||
LongLiveTokenIn,
|
||||
LongLiveTokenOut,
|
||||
ResetPassword,
|
||||
|
@ -15,6 +17,7 @@ const prefix = "/api";
|
|||
|
||||
const routes = {
|
||||
usersSelf: `${prefix}/users/self`,
|
||||
groupsSelf: `${prefix}/users/self/group`,
|
||||
passwordReset: `${prefix}/users/reset-password`,
|
||||
passwordChange: `${prefix}/users/password`,
|
||||
users: `${prefix}/users`,
|
||||
|
@ -33,6 +36,10 @@ export class UserApi extends BaseCRUDAPI<UserIn, UserOut, UserBase> {
|
|||
baseRoute: string = routes.users;
|
||||
itemRoute = (itemid: string) => routes.usersId(itemid);
|
||||
|
||||
async getSelfGroup(): Promise<RequestResponse<GroupInDB>> {
|
||||
return await this.requests.get(routes.groupsSelf, {});
|
||||
}
|
||||
|
||||
async addFavorite(id: string, slug: string) {
|
||||
return await this.requests.post(routes.usersIdFavoritesSlug(id, slug), {});
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue