Skip to content

Commit 9f0850a

Browse files
Merge pull request #11 from NYCU-SDC/fix/add-proxy
fix: add proxy to vite.config.ts
2 parents 69ee2f7 + f264a0a commit 9f0850a

File tree

3 files changed

+17
-2
lines changed

3 files changed

+17
-2
lines changed

src/features/dashboard/components/AdminSettingsPage.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,14 @@ const toMemberRow = (value: unknown): MemberRow | null => {
4141

4242
export const AdminSettingsPage = () => {
4343
// NOTE: current routes are hard-coded to /orgs/sdc/*
44-
const orgSlug = "sdc";
44+
const orgSlug = "SDC";
4545

4646
const orgQuery = useOrg(orgSlug);
4747
const membersQuery = useOrgMembers(orgSlug);
4848

49+
console.log("orgQuery", { status: orgQuery.status, data: orgQuery.data, error: orgQuery.error });
50+
console.log("membersQuery", { status: membersQuery.status, data: membersQuery.data, error: membersQuery.error });
51+
4952
const updateOrgMutation = useUpdateOrg(orgSlug);
5053
const addMemberMutation = useAddOrgMember(orgSlug);
5154
const removeMemberMutation = useRemoveOrgMember(orgSlug);

src/features/form/components/AdminFormsPage.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { useNavigate } from "react-router-dom";
66
import styles from "./AdminFormsPage.module.css";
77
import { StatusTag, type StatusVariant } from "./StatusTag";
88
import { TabButtons } from "./TabButtons";
9-
9+
// import {getInboxMessages} from "@nycu-sdc/core-system-sdk";
1010
// Mock data
1111
const mockForms: { id: string; title: string; lastEdited: string; responses: number; status: StatusVariant; deadline: string }[] = [
1212
{

vite.config.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,17 @@ export default defineConfig({
99
alias: {
1010
"@": path.resolve(__dirname, "./src")
1111
}
12+
},
13+
server: {
14+
proxy: {
15+
"/api": {
16+
target: "https://dev.core-system.sdc.nycu.club",
17+
changeOrigin: true,
18+
secure: true, // HTTPS
19+
cookieDomainRewrite: {
20+
"dev.core-system.sdc.nycu.club": "localhost"
21+
}
22+
}
23+
}
1224
}
1325
});

0 commit comments

Comments
 (0)