1
0
Fork 0
mirror of https://github.com/mealie-recipes/mealie.git synced 2025-08-04 21:15:22 +02:00

remove potentially sensitive fields from group self

This commit is contained in:
Michael Genson 2024-03-15 19:50:39 +00:00
parent b6ccb9fbdb
commit 52c6fe34b2
5 changed files with 29 additions and 7 deletions

View file

@ -1,8 +1,8 @@
import { useAsync, ref } from "@nuxtjs/composition-api";
import { useUserApi } from "~/composables/api";
import { GroupBase, GroupInDB } from "~/lib/api/types/user";
import { GroupBase, GroupSummary } from "~/lib/api/types/user";
const groupSelfRef = ref<GroupInDB | null>(null);
const groupSelfRef = ref<GroupSummary | null>(null);
const loading = ref(false);
export const useGroupSelf = function () {

View file

@ -48,6 +48,13 @@ export interface GroupInDB {
users?: UserOut[];
preferences?: ReadGroupPreferences;
}
export interface GroupSummary {
name: string;
id: string;
slug: string;
preferences?: ReadGroupPreferences;
}
export interface CategoryBase {
name: string;
id: string;

View file

@ -1,5 +1,5 @@
import { BaseCRUDAPI } from "../base/base-clients";
import { CategoryBase, GroupBase, GroupInDB, UserOut } from "~/lib/api/types/user";
import { CategoryBase, GroupBase, GroupInDB, GroupSummary, UserOut } from "~/lib/api/types/user";
import {
CreateInviteToken,
GroupAdminUpdate,
@ -35,7 +35,7 @@ export class GroupAPI extends BaseCRUDAPI<GroupBase, GroupInDB, GroupAdminUpdate
/** Returns the Group Data for the Current User
*/
async getCurrentUserGroup() {
return await this.requests.get<GroupInDB>(routes.groupsSelf);
return await this.requests.get<GroupSummary>(routes.groupsSelf);
}
async getCategories() {