folder-type.ts 575 B

12345678910111213141516171819202122232425
  1. import { ui18n } from "@/lang";
  2. import { FOLDER_TYPE_LIST } from "./constant";
  3. import axios from "./instance";
  4. export interface FloderType {
  5. filesTypeId: number;
  6. filesTypeName: string;
  7. parentId: number;
  8. modalShow?: boolean;
  9. flatShow?: boolean;
  10. }
  11. export type FloderTypes = FloderType[];
  12. export const fetchFloderTypes = async () => {
  13. const types = await axios.get<FloderTypes>(FOLDER_TYPE_LIST);
  14. types.push({
  15. filesTypeId: -1,
  16. filesTypeName: ui18n.t('floder.photo'),
  17. flatShow: false,
  18. modalShow: false,
  19. parentId: 39,
  20. });
  21. return types;
  22. };