admin roadmap filter & search, user management, reopen rejected, system health
This commit is contained in:
@@ -11,12 +11,18 @@ import { tripService } from "@/server/services/trip.service";
|
||||
import { organizerService } from "@/server/services/organizer.service";
|
||||
import { revalidatePath } from "next/cache";
|
||||
import { tripStoredInstantFromYmd } from "@/lib/trip-dates";
|
||||
import { requireActiveUser } from "@/lib/auth-guards";
|
||||
|
||||
export async function createTripAction(formData: FormData) {
|
||||
const session = await getServerSession(authOptions);
|
||||
if (!session?.user) {
|
||||
return { error: "Kamu harus login terlebih dahulu" };
|
||||
}
|
||||
try {
|
||||
await requireActiveUser(session.user.id);
|
||||
} catch (err) {
|
||||
return { error: (err as Error).message };
|
||||
}
|
||||
|
||||
const raw = {
|
||||
category: formData.get("category") as string,
|
||||
@@ -120,6 +126,7 @@ export async function joinTripAction(tripId: string) {
|
||||
}
|
||||
|
||||
try {
|
||||
await requireActiveUser(session.user.id);
|
||||
await tripService.joinTrip(tripId, session.user.id);
|
||||
revalidatePath(`/trips/${tripId}`);
|
||||
revalidatePath("/trips");
|
||||
|
||||
Reference in New Issue
Block a user