Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export const DriverDashboard = () => {

let driverTrips = [{}] as Booking[];

const tripQuery = api.bookings.getDriverTrip.useQuery(
const tripQuery = api.bookings.getAll.useQuery(
{
startDate: dateJSON.startDate,
endDate: dateJSON.endDate,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { Group, Stack } from "@mantine/core";
import { useState } from "react";
import Button from "@/app/_components/common/button/Button";
import SurveyNotification from "@/app/_components/drivercomponents/surveyNotification/surveyNotification";
import { authClient } from "@/lib/auth-client";
import { api } from "@/trpc/react";
import type { Booking, Survey } from "@/types/types";

Expand All @@ -19,6 +20,7 @@ export default function SurveyViewToggle({
initialSurveys,
}: SurveyViewToggleProps) {
const [activeView, setActiveView] = useState<View>("pending");
const { data: session } = authClient.useSession();

// will update every 60 seconds
const { data: surveys = [] } = api.surveys.getAll.useQuery(undefined, {
Expand Down
2 changes: 1 addition & 1 deletion src/server/api/routers/bookings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ export const bookingsRouter = createTRPCRouter({
conditions.push(eq(bookings.surveyCompleted, input.surveyCompleted));
}

if (role === "admin") {
if (role === "admin" || role === "driver") {
return ctx.db
.select()
.from(bookings)
Expand Down