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 { |
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/[email protected]/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
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
info - Need to disable some ESLint rules? Learn more here: https://nextjs.org/docs/basic-features/eslint#disabling-rules | |
info - Creating an optimized production build | |
info - Compiled successfully | |
info - Collecting page data | |
info - Generating static pages (3/3) | |
> Build error occurred | |
Error: Cannot find module for page: / | |
at pageNotFoundError (/Users/junior/projects/news-scraper/node_modules/next/dist/server/require.js:16:17) | |
at Object.getPagePath (/Users/junior/projects/news-scraper/node_modules/next/dist/server/require.js:39:15) |
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
Argument of type '({ req, res, }: GetServerSidePropsContext<ParsedUrlQuery, PreviewData>) => Promise<{ props: { user: User; data?: undefined; }; } | { ...; }>' is not assignable to parameter of type '(context: GetServerSidePropsContext<ParsedUrlQuery, PreviewData>) => GetServerSidePropsResult<{ user: User; data?: undefined; }> | Promise<...>'. | |
Type 'Promise<{ props: { user: User; data?: undefined; }; } | { props: { user: User | undefined; data: string; }; }>' is not assignable to type 'GetServerSidePropsResult<{ user: User; data?: undefined; }> | Promise<GetServerSidePropsResult<{ user: User; data?: undefined; }>>'. | |
Type 'Promise<{ props: { user: User; data?: undefined; }; } | { props: { user: User | undefined; data: string; }; }>' is not assignable to type 'Promise<GetServerSidePropsResult<{ user: User; data?: undefined; }>>'. | |
Type '{ props: { user: User; data?: undefined; }; } | { props: { user: User | undefined; data: string; }; }' is not assignable to type 'GetServerSidePropsResult<{ user: Use |
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
CREATE VIEW HOUR_RATE_BI ( | |
WITH | |
hourrate | |
AS | |
( | |
SELECT (jsonb_each(config.value)).key AS date, | |
(jsonb_each(config.value)).value AS rate | |
FROM config | |
WHERE ((config.key) | |
::text='price/hour_rate'::text) |
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 request from 'supertest' | |
import http, { IncomingMessage, ServerResponse } from 'http' | |
import { apiResolver } from 'next/dist/next-server/server/api-utils' | |
import handler from '../applicantsGet' | |
describe('testing request query params', () => { | |
// mock for `apiResolver`'s 5th parameter to please TS | |
const apiPreviewPropsMock = { | |
previewModeId: 'id', |
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
// pages/api/endpointGet.ts | |
// ... | |
export default otherrMiddleware(auth(handler)) |
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
// pages/api/endpointGet.ts | |
import { auth } from "../util/middleware/auth" | |
// so we can add the user info to the req object | |
type NextApiRequestWithUser = NextApiRequest & { | |
user: string | |
} | |
const handler = async (req: NextApiRequestWithUser, res: NextApiResponse) => { | |
const { method, headers, query, user } = req |
NewerOlder