fix: move initialNotificationActionState out of 'use server' file

Memory [[feedback_use_server_only_async]]: 'use server' files can only
export async functions. notification-actions.ts also exported the
NotificationActionState type and an initialNotificationActionState const,
which Next 16 now flags hard at runtime ('A "use server" file can only
export async functions, found object.').

Moved both to a sibling notification-types.ts (same pattern we already
follow for connection-types / job-file-types / prosthetic-types). The
client component imports the const from -types and the actions from
-actions; no behaviour change.
This commit is contained in:
kovakmedya
2026-05-21 21:28:11 +03:00
parent 4186d95447
commit 7c777a5b27
3 changed files with 8 additions and 8 deletions
+1 -7
View File
@@ -6,13 +6,7 @@ import { AppwriteException, Query } from "node-appwrite";
import { DATABASE_ID, TABLES, type Notification } from "./schema";
import { createAdminClient } from "./server";
import { requireTenant } from "./tenant-guard";
export type NotificationActionState = {
ok: boolean;
error?: string;
};
export const initialNotificationActionState: NotificationActionState = { ok: false };
import type { NotificationActionState } from "./notification-types";
function appwriteError(e: unknown, fallback = "Beklenmeyen bir hata oluştu."): string {
if (e instanceof AppwriteException) return e.message || fallback;
+6
View File
@@ -0,0 +1,6 @@
export type NotificationActionState = {
ok: boolean;
error?: string;
};
export const initialNotificationActionState: NotificationActionState = { ok: false };