Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Trpc #467

Open
wants to merge 23 commits into
base: master
Choose a base branch
from
Open

Trpc #467

wants to merge 23 commits into from

Conversation

ptruong0
Copy link
Contributor

@ptruong0 ptruong0 commented Apr 19, 2024

Description

Screenshots

Steps to verify/test this change:

  • Verify changes work as expected on staging instance

Final Checks:

  • Verify successful deployment

(optional)

  • Write tests
  • Write documentation

Issues

Closes #460

@ptruong0
Copy link
Contributor Author

There's a bug with the schedule: the name of the current quarter ("Summerwk2") does not match the name of the terms in the WebSoc current quarter ("Summer Week 2"), so there is a bug in the getTermDeptNum route in the schedule router.

see https://peterportal.org/course/I&CSCI6B

@ptruong0 ptruong0 requested a review from js0mmer April 19, 2024 07:50
@ptruong0
Copy link
Contributor Author

Reviews and roadmap not migrated yet

api/package.json Outdated Show resolved Hide resolved
import * as trpcExpress from '@trpc/server/adapters/express';
import { TRPCError, initTRPC } from '@trpc/server';

export const createContext = ({ req, res }: trpcExpress.CreateExpressContextOptions) => ({
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

something with this type here is throwing a typescript error

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure why it says Property 'session' does not exist on type 'Request<ParamsDictionary, any, any, ParsedQs, Record<string, any>> but the property definitely does exist

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(req as Request).session

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Express.Request.session: Session & Partial

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

import { Request } from 'express';
import { Session, SessionData } from 'express-session';
import '../types/types';
session: (req as Request & { session: Session & Partial<SessionData> }).session,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add tRPC
2 participants