This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const PericiaList = () => { | |
| const navigate = useNavigate(); | |
| const [isLoading, setIsLoading] = useState(true); | |
| const [pericias, setPericias] = useState([] as PericiaWithCarAndCostumer[]); | |
| const [periciasFiltered, setPericiasFiltered] = useState( | |
| [] as PericiaWithCarAndCostumer[] | |
| ); | |
| const periciasFilterContext = useContext( | |
| PericiasFilterContext | |
| ) as PericiasFilterContextProps; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { serve } from "https://deno.land/std@0.177.0/http/server.ts"; | |
| import { corsHeaders } from "../_shared/cors.ts"; | |
| import { USER_ROLES } from "../_shared/roles.ts"; | |
| import { | |
| throwCustomError, | |
| throwInternalCustomError, | |
| handleErrorResponse, | |
| } from "../_shared/customError.ts"; | |
| import { UNAUTHORIZED_ERROR, USER_NOT_FOUND_ERROR, newMissingParametersError } from "../_shared/errors.ts"; | |
| import { createNewSupabaseClient } from "../_shared/client.ts"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| serve(async (req: Request): Promise<Response> => { | |
| if (req.method === "OPTIONS") { | |
| return new Response("ok", { headers: corsHeaders }); | |
| } | |
| return await handleRequest(req); | |
| }); | |
| const handleRequest = async (req: Request): Promise<Response> => { | |
| try { |
OlderNewer