Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
61 changes: 61 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: CI

on:
push:
branches: [main, develop]
pull_request:
branches: [main, develop]

concurrency:
group: ci-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 24
cache: npm
- run: npm ci
- run: npm run lint

format:
name: Format check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 24
cache: npm
- run: npm ci
- run: npm run format:check

typecheck:
name: Type check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 24
cache: npm
- run: npm ci
- run: npx tsc --noEmit

build:
name: Build
runs-on: ubuntu-latest
needs: [lint, format, typecheck]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 24
cache: npm
- run: npm ci
- run: npm run build
280 changes: 140 additions & 140 deletions aa.md

Large diffs are not rendered by default.

44 changes: 24 additions & 20 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 12 additions & 3 deletions src/entities/diet/model/diet.store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,10 @@ export const useDietStore = create<DietState>((set, get) => ({
const data = await getDietsApi();
set({ diets: data, isLoading: false });
} catch (err: unknown) {
set({ error: extractErrorMessage(err, "식단 목록 조회 중 오류가 발생했습니다."), isLoading: false });
set({
error: extractErrorMessage(err, "식단 목록 조회 중 오류가 발생했습니다."),
isLoading: false,
});
}
},

Expand All @@ -67,7 +70,10 @@ export const useDietStore = create<DietState>((set, get) => ({
const data = await getDietApi(dietId);
set({ currentDiet: data, isLoading: false });
} catch (err: unknown) {
set({ error: extractErrorMessage(err, "식단 조회 중 오류가 발생했습니다."), isLoading: false });
set({
error: extractErrorMessage(err, "식단 조회 중 오류가 발생했습니다."),
isLoading: false,
});
}
},

Expand Down Expand Up @@ -113,7 +119,10 @@ export const useDietStore = create<DietState>((set, get) => ({
const data = await getLeftoversApi(dietId);
set({ leftovers: data, isLoading: false });
} catch (err: unknown) {
set({ error: extractErrorMessage(err, "잔반 데이터 조회 중 오류가 발생했습니다."), isLoading: false });
set({
error: extractErrorMessage(err, "잔반 데이터 조회 중 오류가 발생했습니다."),
isLoading: false,
});
}
},

Expand Down
3 changes: 2 additions & 1 deletion src/entities/ingredient/lib/badges.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,8 @@ export function isInSeason(name: string, month: number): boolean {
);
}

const IMPORTED_PATTERN = /(수입|외국|중국|미국|호주|베트남|칠레|노르웨이|러시아|태국|필리핀|에콰도르)/;
const IMPORTED_PATTERN =
/(수입|외국|중국|미국|호주|베트남|칠레|노르웨이|러시아|태국|필리핀|에콰도르)/;

/** 원산지가 지역(국내)산인지 판별. 원산지 정보가 없으면 false. */
export function isLocalOrigin(origin: string | undefined): boolean {
Expand Down
5 changes: 1 addition & 4 deletions src/features/admin/api/admin.api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,7 @@ import { instance } from "@/shared/api";
import type { SignupRequestResponse } from "@/entities/auth";
import type { PageSignupRequestItem } from "../model/types";

export async function getSignupRequestsApi(
page = 0,
size = 20,
): Promise<PageSignupRequestItem> {
export async function getSignupRequestsApi(page = 0, size = 20): Promise<PageSignupRequestItem> {
const response = await instance.get<PageSignupRequestItem>("/admin/signup-requests", {
params: { page, size },
requiresAuth: true,
Expand Down
24 changes: 14 additions & 10 deletions src/features/admin/ui/SignupRequestList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,17 @@ import type { SignupRequestItem } from "../model/types";
type PendingAction = { type: "approve" | "reject"; item: SignupRequestItem } | null;

export function SignupRequestList() {
const { requests, page, totalPages, isLoading, actionLoading, error, fetchRequests, approve, reject } =
useAdminStore();
const {
requests,
page,
totalPages,
isLoading,
actionLoading,
error,
fetchRequests,
approve,
reject,
} = useAdminStore();
const [pendingAction, setPendingAction] = useState<PendingAction>(null);

useEffect(() => {
Expand All @@ -35,7 +44,7 @@ export function SignupRequestList() {
<>
{/* 대기 건수 */}
{!isLoading && !error && (
<p className="mb-4 font-mono text-[11px] font-medium uppercase tracking-[0.06em] text-[#f5a623]">
<p className="mb-4 font-mono text-[11px] font-medium tracking-[0.06em] text-[#f5a623] uppercase">
대기 중 {pendingRequests.length}건
</p>
)}
Expand All @@ -46,7 +55,6 @@ export function SignupRequestList() {
<div className="flex items-center justify-center rounded-xl border border-[#ebebeb] bg-white py-16">
<span className="text-sm text-[#8f8f8f]">불러오는 중…</span>
</div>

) : error ? (
<div className="flex flex-col items-center gap-3 rounded-xl border border-[#ebebeb] bg-white py-16">
<span className="text-sm text-[#4d4d4d]">{error}</span>
Expand All @@ -58,13 +66,11 @@ export function SignupRequestList() {
다시 시도
</button>
</div>

) : pendingRequests.length === 0 ? (
<div className="flex flex-col items-center gap-1.5 rounded-xl border border-[#ebebeb] bg-white py-16">
<p className="text-sm font-medium text-[#171717]">처리 대기 중인 요청이 없습니다</p>
<p className="text-xs text-[#8f8f8f]">모든 가입 요청이 처리되었습니다.</p>
</div>

) : (
pendingRequests.map((item) => (
<div
Expand All @@ -79,9 +85,7 @@ export function SignupRequestList() {

{/* 이름 + 면허번호 */}
<div className="min-w-0 flex-1">
<p className="text-sm font-medium tracking-[-0.01em] text-[#171717]">
{item.name}
</p>
<p className="text-sm font-medium tracking-[-0.01em] text-[#171717]">{item.name}</p>
<p
className="mt-0.5 font-mono text-xs text-[#8f8f8f]"
style={{ fontVariantNumeric: "tabular-nums" }}
Expand All @@ -91,7 +95,7 @@ export function SignupRequestList() {
</div>

{/* 상태 */}
<span className="shrink-0 font-mono text-[11px] font-medium uppercase tracking-[0.04em] text-[#f5a623]">
<span className="shrink-0 font-mono text-[11px] font-medium tracking-[0.04em] text-[#f5a623] uppercase">
대기 중
</span>

Expand Down
5 changes: 1 addition & 4 deletions src/features/ai-meal-generator/model/generator.store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,10 +84,7 @@ export const useGeneratorStore = create<GeneratorState>((set, get) => ({
set((s) => ({
conditions: {
...s.conditions,
nutritionCriteria: [
...s.conditions.nutritionCriteria,
{ id: crypto.randomUUID(), label },
],
nutritionCriteria: [...s.conditions.nutritionCriteria, { id: crypto.randomUUID(), label }],
},
})),

Expand Down
Loading
Loading