mirror of
https://github.com/fosrl/pangolin.git
synced 2026-02-04 17:09:30 +00:00
refactor contexts, format zod errors, and more refactoring
This commit is contained in:
11
src/contexts/orgContext.ts
Normal file
11
src/contexts/orgContext.ts
Normal file
@@ -0,0 +1,11 @@
|
||||
import { GetOrgResponse } from "@server/routers/org";
|
||||
import { createContext } from "react";
|
||||
|
||||
interface OrgContextType {
|
||||
org: GetOrgResponse | null;
|
||||
updateOrg: (updateOrg: Partial<GetOrgResponse>) => void;
|
||||
}
|
||||
|
||||
const OrgContext = createContext<OrgContextType | undefined>(undefined);
|
||||
|
||||
export default OrgContext;
|
||||
@@ -3,9 +3,11 @@ import { createContext } from "react";
|
||||
|
||||
interface ResourceContextType {
|
||||
resource: GetResourceResponse | null;
|
||||
updateResource: (updatedResource: Partial<GetResourceResponse>) => Promise<void>;
|
||||
updateResource: (updatedResource: Partial<GetResourceResponse>) => void;
|
||||
}
|
||||
|
||||
const ResourceContext = createContext<ResourceContextType | undefined>(undefined);
|
||||
const ResourceContext = createContext<ResourceContextType | undefined>(
|
||||
undefined
|
||||
);
|
||||
|
||||
export default ResourceContext;
|
||||
export default ResourceContext;
|
||||
|
||||
@@ -3,9 +3,9 @@ import { createContext } from "react";
|
||||
|
||||
interface SiteContextType {
|
||||
site: GetSiteResponse | null;
|
||||
updateSite: (updatedSite: Partial<GetSiteResponse>) => Promise<void>;
|
||||
updateSite: (updatedSite: Partial<GetSiteResponse>) => void;
|
||||
}
|
||||
|
||||
const SiteContext = createContext<SiteContextType | undefined>(undefined);
|
||||
|
||||
export default SiteContext;
|
||||
export default SiteContext;
|
||||
|
||||
Reference in New Issue
Block a user