Kovak Yazılım kurumsal site — Next.js 16 + Appwrite
- 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
This commit is contained in:
+34
@@ -0,0 +1,34 @@
|
||||
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 [];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user