3b3efafcc8
- Anasayfa, Hizmetler, Projeler, Hakkımızda, İletişim sayfaları - Header/Footer, Hero, ServicesGrid, ProjectsGrid, ContactForm bileşenleri - Appwrite TablesDB entegrasyonu (services, projects, contact_messages) - Server Action ile iletişim formu (submitContact) - Brand palette: navy #0F2C5C + sky #4DA3C7 - kovakyazilim.com'dan alınan logo public/logo.png
35 lines
1.0 KiB
TypeScript
35 lines
1.0 KiB
TypeScript
import "server-only";
|
|
import { Query } from "node-appwrite";
|
|
import { serverTablesDB, DATABASE_ID, TABLES } from "@/lib/appwrite-server";
|
|
import type { ProjectRow, ServiceRow } from "@/lib/types";
|
|
|
|
export async function listServices(opts?: { featured?: boolean }) {
|
|
const queries = [Query.orderAsc("order"), Query.limit(50)];
|
|
if (opts?.featured) queries.unshift(Query.equal("featured", true));
|
|
try {
|
|
const res = await serverTablesDB.listRows<ServiceRow>({
|
|
databaseId: DATABASE_ID,
|
|
tableId: TABLES.services,
|
|
queries,
|
|
});
|
|
return res.rows;
|
|
} catch {
|
|
return [];
|
|
}
|
|
}
|
|
|
|
export async function listProjects(opts?: { featured?: boolean; limit?: number }) {
|
|
const queries = [Query.orderDesc("year"), Query.limit(opts?.limit ?? 50)];
|
|
if (opts?.featured) queries.unshift(Query.equal("featured", true));
|
|
try {
|
|
const res = await serverTablesDB.listRows<ProjectRow>({
|
|
databaseId: DATABASE_ID,
|
|
tableId: TABLES.projects,
|
|
queries,
|
|
});
|
|
return res.rows;
|
|
} catch {
|
|
return [];
|
|
}
|
|
}
|