Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
9826053
feat(scheduling): add availability calendar component and time slot u…
achneerov May 18, 2026
2576b75
feat(scheduling): implement availability calendar component for time …
achneerov May 18, 2026
04944ab
refactor(scheduling): remove availability calendar component
achneerov May 18, 2026
d4a8725
fix(scheduling): update availability calendar to use configurable sta…
achneerov May 18, 2026
747457e
style(scheduling): enhance week headers in availability calendar with…
achneerov May 18, 2026
f20a4d8
refactor(scheduling): improve availability calendar drag-and-drop fun…
achneerov May 18, 2026
337d7e5
refactor(scheduling): enhance availability calendar with configurable…
achneerov May 18, 2026
0a5a653
feat(scheduling): add user availability section with calendar and coa…
achneerov May 18, 2026
4aa20c4
style(scheduling): refine availability calendar styles by removing un…
achneerov May 18, 2026
9e2df87
asdasd
achneerov May 18, 2026
9957227
refactor(scheduling): enhance drag-and-drop functionality in availabi…
achneerov May 18, 2026
2d3c28a
style(scheduling): update availability calendar to use sticky positio…
achneerov May 18, 2026
ff79b81
refactor(scheduling): streamline availability calendar layout by cons…
achneerov May 18, 2026
4d1a953
chore(scheduling): remove unused SchedulingAvailabilitySection component
achneerov May 18, 2026
649338f
refactor(scheduling): improve drag-and-drop state management in avail…
achneerov May 18, 2026
8d7b873
refactor(scheduling): clean up time-slot.ts by removing outdated comm…
achneerov May 18, 2026
f202acf
refactor(scheduling): wire availability form to action and address PR…
achneerov May 18, 2026
5187421
refactor(scheduling): replace hardcoded quarter indices with constant…
achneerov May 25, 2026
0c8151c
refactor(scheduling): improved layout and ui
martin0024 May 31, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 13 additions & 2 deletions app/scheduling/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,11 @@ const selectAvailabilitiesSchema = z.object({
time_slots: z
.array(timeSlotSchema)
.min(1, "At least one time slot is required")
.max(50,"You can select up to 50 time slots")
.max(50,"You can select up to 50 time slots"),
notes: z
.string()
.max(2000, "Message must be 2000 characters or fewer")
.optional(),
});

const selectTimeSlotSchema = z.object({
Expand Down Expand Up @@ -120,9 +124,14 @@ export async function selectAvailabilities(
return {errors: {time_slots: ["Invalid time slots format"]}};
}

const rawNotes = formData.get("notes");
const parsed = selectAvailabilitiesSchema.safeParse({
session_id: formData.get("session_id")?.toString(),
time_slots: rawTimeSlots
time_slots: rawTimeSlots,
notes:
typeof rawNotes === "string" && rawNotes.trim().length > 0
? rawNotes
: undefined,
})

if (!parsed.success) {
Expand All @@ -131,6 +140,7 @@ export async function selectAvailabilities(

const sessionId = parsed.data.session_id;
const timeSlots = parsed.data.time_slots.map(normalizeSlots)
const notes = parsed.data.notes ?? null;

// 3. Authorization: caller must be the coach or user on this session
const result = await getAuthorizedSession(sessionId, callerId);
Expand All @@ -153,6 +163,7 @@ export async function selectAvailabilities(
.update(coachingSessions)
.set({
selectedTimeSlots: timeSlots,
notes,
updatedAt: new Date(),
})
.where(eq(coachingSessions.id, sessionId));
Expand Down
Loading
Loading