Files
Vector/apps/web/src/lib/api/manufacturers.ts
T
josh 7c0d422228
CI / Lint · Typecheck · Test · Build (push) Failing after 5m41s
CI / Playwright (smoke) (push) Has been skipped
chore: initial Vector 2.0 monorepo
Ground-up TypeScript rewrite of the Vector hardware parts inventory
system. Ships the full roadmap (Phases 0-8) in one initial commit:

- pnpm + Turbo monorepo: apps/{api,web,e2e}, packages/{db,shared,ui,config}
- Express 5 + Prisma 5 + zod validation + JWT w/ refresh-token rotation
- React 19 + Vite + shadcn/ui + TanStack Query/Table + nuqs URL state
- Repair/RMA, tags, bulk ops, saved views, CSV audit export
- Analytics dashboard on Recharts + EOL tracking
- Signed webhook subscriptions (HMAC-SHA256) with in-process emitter
- Vitest unit tests (shared schemas, api services/helpers) + Playwright skeleton
- Gitea Actions CI (lint, typecheck, test+coverage, build) + Renovate

Deferred follow-ups: Postgres cutover (data-migration script ready),
BullMQ worker for webhook delivery, @react-pdf PDF export, CSV import wizard.
2026-04-16 20:52:32 -04:00

34 lines
966 B
TypeScript

import type {
CreateManufacturerRequest,
UpdateManufacturerRequest,
} from '@vector/shared';
import { api } from './client.js';
import { getList } from './paginated.js';
import type { Manufacturer } from './types.js';
export type ManufacturerListFilters = {
page?: number;
pageSize?: number;
};
export function listManufacturers(filters: ManufacturerListFilters = {}) {
return getList<Manufacturer>('/manufacturers', filters);
}
export async function createManufacturer(input: CreateManufacturerRequest): Promise<Manufacturer> {
const res = await api.post<Manufacturer>('/manufacturers', input);
return res.data;
}
export async function updateManufacturer(
id: string,
input: UpdateManufacturerRequest,
): Promise<Manufacturer> {
const res = await api.patch<Manufacturer>(`/manufacturers/${id}`, input);
return res.data;
}
export async function deleteManufacturer(id: string): Promise<void> {
await api.delete(`/manufacturers/${id}`);
}