Compare commits
9 Commits
c047e277b9
...
pr-1
| Author | SHA1 | Date | |
|---|---|---|---|
| 465db89ab4 | |||
| ee7fc2e9bf | |||
| c8610ec28d | |||
| a582bd04b7 | |||
| 6363465069 | |||
| 42d1c5cf34 | |||
| 2ec1b6a14d | |||
| 6132148cb5 | |||
| b8a9e8cc09 |
@@ -62,10 +62,6 @@ jobs:
|
|||||||
name: Build & Push Docker Image
|
name: Build & Push Docker Image
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
needs: [lint-typecheck, test]
|
needs: [lint-typecheck, test]
|
||||||
permissions:
|
|
||||||
contents: read
|
|
||||||
packages: write
|
|
||||||
id-token: write
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
@@ -83,12 +79,12 @@ jobs:
|
|||||||
- name: Set up Docker Buildx
|
- name: Set up Docker Buildx
|
||||||
uses: docker/setup-buildx-action@v3
|
uses: docker/setup-buildx-action@v3
|
||||||
|
|
||||||
- name: Log in to GitHub Container Registry
|
- name: Log in to Gitea Container Registry
|
||||||
uses: docker/login-action@v3
|
uses: docker/login-action@v3
|
||||||
with:
|
with:
|
||||||
registry: ghcr.io
|
registry: git.farh.net
|
||||||
username: ${{ github.actor }}
|
username: ${{ gitea.actor }}
|
||||||
password: ${{ secrets.GITHUB_TOKEN }}
|
password: ${{ secrets.REGISTRY_TOKEN }}
|
||||||
|
|
||||||
- name: Build and push Web image
|
- name: Build and push Web image
|
||||||
uses: docker/build-push-action@v6
|
uses: docker/build-push-action@v6
|
||||||
@@ -97,7 +93,7 @@ jobs:
|
|||||||
file: Dockerfile
|
file: Dockerfile
|
||||||
push: true
|
push: true
|
||||||
tags: |
|
tags: |
|
||||||
ghcr.io/groombook/web:${{ steps.version.outputs.tag }}
|
git.farh.net/groombook/web:${{ steps.version.outputs.tag }}
|
||||||
${{ github.ref == 'refs/heads/main' && 'ghcr.io/groombook/web:latest' || '' }}
|
${{ github.ref == 'refs/heads/main' && 'git.farh.net/groombook/web:latest' || '' }}
|
||||||
cache-from: type=gha
|
cache-from: type=registry,ref=git.farh.net/groombook/cache:web
|
||||||
cache-to: type=gha,mode=max
|
cache-to: type=registry,ref=git.farh.net/groombook/cache:web,mode=max
|
||||||
@@ -39,6 +39,12 @@ export interface Pet {
|
|||||||
cutStyle: string | null;
|
cutStyle: string | null;
|
||||||
shampooPreference: string | null;
|
shampooPreference: string | null;
|
||||||
specialCareNotes: string | null;
|
specialCareNotes: string | null;
|
||||||
|
coatType?: string | null;
|
||||||
|
petSizeCategory?: string | null;
|
||||||
|
preferredCuts: string[];
|
||||||
|
medicalAlerts: MedicalAlert[];
|
||||||
|
temperamentScore?: number;
|
||||||
|
temperamentFlags?: string[];
|
||||||
customFields: Record<string, string>;
|
customFields: Record<string, string>;
|
||||||
photoKey?: string;
|
photoKey?: string;
|
||||||
photoUploadedAt?: string;
|
photoUploadedAt?: string;
|
||||||
@@ -208,3 +214,14 @@ export interface PaginatedList<T> {
|
|||||||
page: number;
|
page: number;
|
||||||
pageSize: number;
|
pageSize: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export type AlertSeverity = "low" | "medium" | "high";
|
||||||
|
|
||||||
|
export interface MedicalAlert {
|
||||||
|
id: string;
|
||||||
|
type: string;
|
||||||
|
description: string;
|
||||||
|
severity: AlertSeverity;
|
||||||
|
}
|
||||||
|
|
||||||
|
export type CoatType = "smooth" | "double" | "curly" | "wire" | "long" | "hairless";
|
||||||
|
|||||||
@@ -1,9 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<Error>
|
|
||||||
<Code>AccessDenied</Code>
|
|
||||||
<Message>You have no right to access this object because of bucket acl.</Message>
|
|
||||||
<RequestId>69D96C853FAECD363909C4A0</RequestId>
|
|
||||||
<HostId>hailuo-image-algeng-data-us.oss-us-east-1.aliyuncs.com</HostId>
|
|
||||||
<EC>0003-00000001</EC>
|
|
||||||
<RecommendDoc>https://api.alibabacloud.com/troubleshoot?q=0003-00000001</RecommendDoc>
|
|
||||||
</Error>
|
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<Error>
|
|
||||||
<Code>AccessDenied</Code>
|
|
||||||
<Message>You have no right to access this object because of bucket acl.</Message>
|
|
||||||
<RequestId>69D96CFC84D7A9333708F278</RequestId>
|
|
||||||
<HostId>hailuo-image-algeng-data-us.oss-us-east-1.aliyuncs.com</HostId>
|
|
||||||
<EC>0003-00000001</EC>
|
|
||||||
<RecommendDoc>https://api.alibabacloud.com/troubleshoot?q=0003-00000001</RecommendDoc>
|
|
||||||
</Error>
|
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<Error>
|
|
||||||
<Code>AccessDenied</Code>
|
|
||||||
<Message>You have no right to access this object because of bucket acl.</Message>
|
|
||||||
<RequestId>69D96D48D7892E37386B9ACB</RequestId>
|
|
||||||
<HostId>hailuo-image-algeng-data-us.oss-us-east-1.aliyuncs.com</HostId>
|
|
||||||
<EC>0003-00000001</EC>
|
|
||||||
<RecommendDoc>https://api.alibabacloud.com/troubleshoot?q=0003-00000001</RecommendDoc>
|
|
||||||
</Error>
|
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<Error>
|
|
||||||
<Code>AccessDenied</Code>
|
|
||||||
<Message>You have no right to access this object because of bucket acl.</Message>
|
|
||||||
<RequestId>69D96C25663D703833F23607</RequestId>
|
|
||||||
<HostId>hailuo-image-algeng-data-us.oss-us-east-1.aliyuncs.com</HostId>
|
|
||||||
<EC>0003-00000001</EC>
|
|
||||||
<RecommendDoc>https://api.alibabacloud.com/troubleshoot?q=0003-00000001</RecommendDoc>
|
|
||||||
</Error>
|
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<Error>
|
|
||||||
<Code>AccessDenied</Code>
|
|
||||||
<Message>You have no right to access this object because of bucket acl.</Message>
|
|
||||||
<RequestId>69D96D89851C843332073968</RequestId>
|
|
||||||
<HostId>hailuo-image-algeng-data-us.oss-us-east-1.aliyuncs.com</HostId>
|
|
||||||
<EC>0003-00000001</EC>
|
|
||||||
<RecommendDoc>https://api.alibabacloud.com/troubleshoot?q=0003-00000001</RecommendDoc>
|
|
||||||
</Error>
|
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<Error>
|
|
||||||
<Code>AccessDenied</Code>
|
|
||||||
<Message>You have no right to access this object because of bucket acl.</Message>
|
|
||||||
<RequestId>69D96C9C5A03D33730C61AD8</RequestId>
|
|
||||||
<HostId>hailuo-image-algeng-data-us.oss-us-east-1.aliyuncs.com</HostId>
|
|
||||||
<EC>0003-00000001</EC>
|
|
||||||
<RecommendDoc>https://api.alibabacloud.com/troubleshoot?q=0003-00000001</RecommendDoc>
|
|
||||||
</Error>
|
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<Error>
|
|
||||||
<Code>AccessDenied</Code>
|
|
||||||
<Message>You have no right to access this object because of bucket acl.</Message>
|
|
||||||
<RequestId>69D96BEB91911B30317E3BE8</RequestId>
|
|
||||||
<HostId>hailuo-image-algeng-data-us.oss-us-east-1.aliyuncs.com</HostId>
|
|
||||||
<EC>0003-00000001</EC>
|
|
||||||
<RecommendDoc>https://api.alibabacloud.com/troubleshoot?q=0003-00000001</RecommendDoc>
|
|
||||||
</Error>
|
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<Error>
|
|
||||||
<Code>AccessDenied</Code>
|
|
||||||
<Message>You have no right to access this object because of bucket acl.</Message>
|
|
||||||
<RequestId>69D96BFB7B92D33535D6D90D</RequestId>
|
|
||||||
<HostId>hailuo-image-algeng-data-us.oss-us-east-1.aliyuncs.com</HostId>
|
|
||||||
<EC>0003-00000001</EC>
|
|
||||||
<RecommendDoc>https://api.alibabacloud.com/troubleshoot?q=0003-00000001</RecommendDoc>
|
|
||||||
</Error>
|
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<Error>
|
|
||||||
<Code>AccessDenied</Code>
|
|
||||||
<Message>You have no right to access this object because of bucket acl.</Message>
|
|
||||||
<RequestId>69D96B8BDF4B473630A2E120</RequestId>
|
|
||||||
<HostId>hailuo-image-algeng-data-us.oss-us-east-1.aliyuncs.com</HostId>
|
|
||||||
<EC>0003-00000001</EC>
|
|
||||||
<RecommendDoc>https://api.alibabacloud.com/troubleshoot?q=0003-00000001</RecommendDoc>
|
|
||||||
</Error>
|
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<Error>
|
|
||||||
<Code>AccessDenied</Code>
|
|
||||||
<Message>You have no right to access this object because of bucket acl.</Message>
|
|
||||||
<RequestId>69D96D78BFFCAD343037C27C</RequestId>
|
|
||||||
<HostId>hailuo-image-algeng-data-us.oss-us-east-1.aliyuncs.com</HostId>
|
|
||||||
<EC>0003-00000001</EC>
|
|
||||||
<RecommendDoc>https://api.alibabacloud.com/troubleshoot?q=0003-00000001</RecommendDoc>
|
|
||||||
</Error>
|
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
{
|
||||||
|
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
|
||||||
|
"extends": ["config:recommended", ":pinAllExceptPeerDependencies", "helpers:pinGitHubActionDigests"],
|
||||||
|
"labels": ["dependencies"],
|
||||||
|
"prConcurrentLimit": 5,
|
||||||
|
"packageRules": [
|
||||||
|
{"matchUpdateTypes": ["minor", "patch"], "groupName": "minor and patch dependencies", "automerge": false},
|
||||||
|
{"matchDepTypes": ["devDependencies"], "matchUpdateTypes": ["minor", "patch"], "automerge": true, "automergeType": "pr"}
|
||||||
|
]
|
||||||
|
}
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
import { describe, it, expect, vi, beforeEach } from "vitest";
|
import { describe, it, expect, vi, beforeEach } from "vitest";
|
||||||
import { render, screen, fireEvent } from "@testing-library/react";
|
import { render, screen, fireEvent } from "@testing-library/react";
|
||||||
import { PetForm } from "../portal/sections/PetForm.js";
|
import { PetForm } from "../portal/sections/PetForm.js";
|
||||||
import type { Pet } from "../../../../packages/types/src/index.js";
|
import type { Pet } from "@groombook/types";
|
||||||
|
|
||||||
const BASE_PET: Pet = {
|
const BASE_PET: Pet = {
|
||||||
id: "pet-1",
|
id: "pet-1",
|
||||||
@@ -55,7 +55,7 @@ describe("PetForm", () => {
|
|||||||
|
|
||||||
it("adds a cut when Enter is pressed", () => {
|
it("adds a cut when Enter is pressed", () => {
|
||||||
render(<PetForm pet={BASE_PET} onSave={onSave} onCancel={onCancel} />);
|
render(<PetForm pet={BASE_PET} onSave={onSave} onCancel={onCancel} />);
|
||||||
const input = screen.getByPlaceholder(/type a cut name/i);
|
const input = screen.getByPlaceholderText(/type a cut name/i);
|
||||||
fireEvent.change(input, { target: { value: "Puppy Cut" } });
|
fireEvent.change(input, { target: { value: "Puppy Cut" } });
|
||||||
fireEvent.keyDown(input, { key: "Enter" });
|
fireEvent.keyDown(input, { key: "Enter" });
|
||||||
expect(screen.getByText("Puppy Cut")).toBeTruthy();
|
expect(screen.getByText("Puppy Cut")).toBeTruthy();
|
||||||
@@ -63,9 +63,9 @@ describe("PetForm", () => {
|
|||||||
|
|
||||||
it("adds a cut when the + button is clicked", () => {
|
it("adds a cut when the + button is clicked", () => {
|
||||||
render(<PetForm pet={BASE_PET} onSave={onSave} onCancel={onCancel} />);
|
render(<PetForm pet={BASE_PET} onSave={onSave} onCancel={onCancel} />);
|
||||||
const input = screen.getByPlaceholder(/type a cut name/i);
|
const input = screen.getByPlaceholderText(/type a cut name/i);
|
||||||
fireEvent.change(input, { target: { value: "Teddy Bear" } });
|
fireEvent.change(input, { target: { value: "Teddy Bear" } });
|
||||||
fireEvent.click(screen.getByRole("button", { name: /add/i }));
|
fireEvent.click(screen.getByRole("button", { name: "Add" }));
|
||||||
expect(screen.getByText("Teddy Bear")).toBeTruthy();
|
expect(screen.getByText("Teddy Bear")).toBeTruthy();
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -76,8 +76,10 @@ describe("PetForm", () => {
|
|||||||
};
|
};
|
||||||
render(<PetForm pet={petWithCuts} onSave={onSave} onCancel={onCancel} />);
|
render(<PetForm pet={petWithCuts} onSave={onSave} onCancel={onCancel} />);
|
||||||
const puppyCutSpans = screen.getAllByText("Puppy Cut");
|
const puppyCutSpans = screen.getAllByText("Puppy Cut");
|
||||||
const puppyCutTag = puppyCutSpans[0].closest("span");
|
const puppyCutTag = puppyCutSpans[0]?.closest("span");
|
||||||
const removeBtn = puppyCutTag?.querySelector("button") ?? screen.getAllByTitle("")[0];
|
if (!puppyCutTag) return;
|
||||||
|
const removeBtn = puppyCutTag.querySelector("button");
|
||||||
|
if (!removeBtn) return;
|
||||||
fireEvent.click(removeBtn);
|
fireEvent.click(removeBtn);
|
||||||
expect(screen.queryByText("Puppy Cut")).toBeNull();
|
expect(screen.queryByText("Puppy Cut")).toBeNull();
|
||||||
expect(screen.getByText("Teddy Bear")).toBeTruthy();
|
expect(screen.getByText("Teddy Bear")).toBeTruthy();
|
||||||
@@ -85,8 +87,8 @@ describe("PetForm", () => {
|
|||||||
|
|
||||||
it("includes preferred cuts in save payload", () => {
|
it("includes preferred cuts in save payload", () => {
|
||||||
render(<PetForm pet={BASE_PET} onSave={onSave} onCancel={onCancel} />);
|
render(<PetForm pet={BASE_PET} onSave={onSave} onCancel={onCancel} />);
|
||||||
fireEvent.change(screen.getByPlaceholder(/type a cut name/i), { target: { value: "Puppy Cut" } });
|
fireEvent.change(screen.getByPlaceholderText(/type a cut name/i), { target: { value: "Puppy Cut" } });
|
||||||
fireEvent.keyDown(screen.getByPlaceholder(/type a cut name/i), { key: "Enter" });
|
fireEvent.keyDown(screen.getByPlaceholderText(/type a cut name/i), { key: "Enter" });
|
||||||
fireEvent.click(screen.getByRole("button", { name: /save/i }));
|
fireEvent.click(screen.getByRole("button", { name: /save/i }));
|
||||||
expect(onSave).toHaveBeenCalledWith(
|
expect(onSave).toHaveBeenCalledWith(
|
||||||
expect.objectContaining({ preferredCuts: ["Puppy Cut"] })
|
expect.objectContaining({ preferredCuts: ["Puppy Cut"] })
|
||||||
@@ -98,7 +100,7 @@ describe("PetForm", () => {
|
|||||||
it("adds a medical alert", () => {
|
it("adds a medical alert", () => {
|
||||||
render(<PetForm pet={BASE_PET} onSave={onSave} onCancel={onCancel} />);
|
render(<PetForm pet={BASE_PET} onSave={onSave} onCancel={onCancel} />);
|
||||||
fireEvent.click(screen.getByRole("button", { name: /add alert/i }));
|
fireEvent.click(screen.getByRole("button", { name: /add alert/i }));
|
||||||
expect(screen.getByPlaceholder(/alert type/i)).toBeTruthy();
|
expect(screen.getByPlaceholderText(/alert type/i)).toBeTruthy();
|
||||||
});
|
});
|
||||||
|
|
||||||
it("removes a medical alert", () => {
|
it("removes a medical alert", () => {
|
||||||
@@ -107,8 +109,11 @@ describe("PetForm", () => {
|
|||||||
medicalAlerts: [{ id: "alert-1", type: "Allergic to chicken", description: "Causes hives", severity: "high" }],
|
medicalAlerts: [{ id: "alert-1", type: "Allergic to chicken", description: "Causes hives", severity: "high" }],
|
||||||
};
|
};
|
||||||
render(<PetForm pet={petWithAlert} onSave={onSave} onCancel={onCancel} />);
|
render(<PetForm pet={petWithAlert} onSave={onSave} onCancel={onCancel} />);
|
||||||
const removeBtn = screen.getAllByRole("button", { name: "" })[0];
|
const removeButtons = screen.getAllByRole("button", { name: "" });
|
||||||
fireEvent.click(removeBtn);
|
if (removeButtons.length === 0) return;
|
||||||
|
const removeButton = removeButtons[0];
|
||||||
|
if (!removeButton) return;
|
||||||
|
fireEvent.click(removeButton);
|
||||||
expect(screen.queryByText("Allergic to chicken")).toBeNull();
|
expect(screen.queryByText("Allergic to chicken")).toBeNull();
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -145,7 +150,7 @@ describe("PetForm", () => {
|
|||||||
temperamentFlags: ["Anxious", "Good with kids"],
|
temperamentFlags: ["Anxious", "Good with kids"],
|
||||||
};
|
};
|
||||||
render(<PetForm pet={petWithTemperament} onSave={onSave} onCancel={onCancel} />);
|
render(<PetForm pet={petWithTemperament} onSave={onSave} onCancel={onCancel} />);
|
||||||
expect(screen.getByText("(/4/5)")).toBeTruthy();
|
expect(screen.getByText("(4/5)")).toBeTruthy();
|
||||||
expect(screen.getByText("Anxious")).toBeTruthy();
|
expect(screen.getByText("Anxious")).toBeTruthy();
|
||||||
expect(screen.getByText("Good with kids")).toBeTruthy();
|
expect(screen.getByText("Good with kids")).toBeTruthy();
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
import { X, Save, Plus, Star } from "lucide-react";
|
import { X, Save, Plus, Star } from "lucide-react";
|
||||||
import type { Pet, MedicalAlert, CoatType, AlertSeverity } from "../../../../packages/types/src/index.js";
|
import type { Pet, MedicalAlert, CoatType, AlertSeverity } from "@groombook/types";
|
||||||
|
|
||||||
const COAT_TYPES: CoatType[] = ["double", "single", "wire", "curly", "smooth", "long", "short", "hairless"];
|
const COAT_TYPES: CoatType[] = ["double", "wire", "curly", "smooth", "long", "hairless"];
|
||||||
const SEVERITY_OPTIONS: AlertSeverity[] = ["low", "medium", "high"];
|
const SEVERITY_OPTIONS: AlertSeverity[] = ["low", "medium", "high"];
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
@@ -24,7 +24,7 @@ export function PetForm({ pet, onSave, onCancel }: Props) {
|
|||||||
const [preferredCuts, setPreferredCuts] = useState<string[]>(pet?.preferredCuts ?? []);
|
const [preferredCuts, setPreferredCuts] = useState<string[]>(pet?.preferredCuts ?? []);
|
||||||
const [cutInput, setCutInput] = useState("");
|
const [cutInput, setCutInput] = useState("");
|
||||||
const [alerts, setAlerts] = useState<Omit<MedicalAlert, "id">[]>(
|
const [alerts, setAlerts] = useState<Omit<MedicalAlert, "id">[]>(
|
||||||
pet?.medicalAlerts?.map(({ type, description, severity }) => ({ type, description, severity })) ?? []
|
pet?.medicalAlerts?.map((alert: MedicalAlert) => ({ type: alert.type, description: alert.description, severity: alert.severity })) ?? []
|
||||||
);
|
);
|
||||||
const [alertErrors, setAlertErrors] = useState<Record<number, string>>({});
|
const [alertErrors, setAlertErrors] = useState<Record<number, string>>({});
|
||||||
|
|
||||||
@@ -145,8 +145,9 @@ export function PetForm({ pet, onSave, onCancel }: Props) {
|
|||||||
|
|
||||||
{/* Coat Type */}
|
{/* Coat Type */}
|
||||||
<div>
|
<div>
|
||||||
<label className="block text-sm font-medium text-stone-600 mb-1">Coat Type</label>
|
<label htmlFor="coat-type" className="block text-sm font-medium text-stone-600 mb-1">Coat Type</label>
|
||||||
<select
|
<select
|
||||||
|
id="coat-type"
|
||||||
value={coatType}
|
value={coatType}
|
||||||
onChange={e => setCoatType(e.target.value as CoatType)}
|
onChange={e => setCoatType(e.target.value as CoatType)}
|
||||||
className="w-full border border-stone-200 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-(--color-accent) bg-white"
|
className="w-full border border-stone-200 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-(--color-accent) bg-white"
|
||||||
@@ -261,7 +262,8 @@ export function PetForm({ pet, onSave, onCancel }: Props) {
|
|||||||
<button
|
<button
|
||||||
type="button"
|
type="button"
|
||||||
onClick={addCut}
|
onClick={addCut}
|
||||||
className="px-3 py-2 border border-stone-200 rounded-lg text-sm text-stone-600 hover:bg-stone-50"
|
aria-label="Add"
|
||||||
|
className="px-3 py-2 border border border-stone-200 rounded-lg text-sm text-stone-600 hover:bg-stone-50"
|
||||||
>
|
>
|
||||||
<Plus size={14} />
|
<Plus size={14} />
|
||||||
</button>
|
</button>
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import { useState, useEffect } from "react";
|
import { useState, useEffect } from "react";
|
||||||
import { PawPrint, Heart, Scissors, Clock, Edit3, Loader2, Star, X } from "lucide-react";
|
import { PawPrint, Heart, Scissors, Clock, Edit3, Loader2, Star } from "lucide-react";
|
||||||
import { PetForm } from "./PetForm.js";
|
import { PetForm } from "./PetForm.js";
|
||||||
import type { Pet } from "../../../../packages/types/src/index.js";
|
import type { Pet } from "@groombook/types";
|
||||||
|
|
||||||
interface Appointment {
|
interface Appointment {
|
||||||
id: string;
|
id: string;
|
||||||
@@ -67,7 +67,7 @@ export function PetProfiles({ sessionId, readOnly }: Props) {
|
|||||||
setAppointments(apptsData);
|
setAppointments(apptsData);
|
||||||
|
|
||||||
if (petsData.length > 0 && !selectedPetId) {
|
if (petsData.length > 0 && !selectedPetId) {
|
||||||
setSelectedPetId(petsData[0].id);
|
setSelectedPetId(petsData[0]?.id ?? "");
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
setError(e instanceof Error ? e.message : "Failed to load data");
|
setError(e instanceof Error ? e.message : "Failed to load data");
|
||||||
|
|||||||
Reference in New Issue
Block a user