Skip to content

Commit

Permalink
Merge pull request #18 from ChangePlusPlusVandy/rohan/moveBaseId
Browse files Browse the repository at this point in the history
finished change
  • Loading branch information
franklinhu88 authored Oct 20, 2024
2 parents d42332d + f781729 commit 656a37f
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 11 deletions.
4 changes: 1 addition & 3 deletions src/controllers/Dashboard.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,7 @@ import type { Request, Response } from 'express';
* @param res - the response object
*/
export const getDashboardStats = async (req: Request, res: Response) => {
const base = new Airtable({ apiKey: process.env.AIRTABLE_API_KEY || '' }).base(
'appwPsfAb6U8CV3mf'
);
const base = new Airtable({ apiKey: process.env.AIRTABLE_API_KEY || '' }).base(process.env.AIRTABLE_BASE_ID || '');

try {
await base('Data Table')
Expand Down
6 changes: 3 additions & 3 deletions src/controllers/FlightRequest.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ dotenv.config();

const base = new Airtable({
apiKey: process.env.AIRTABLE_API_KEY || '',
}).base('appwPsfAb6U8CV3mf');
}).base(process.env.AIRTABLE_BASE_ID || '');

/**
* Get all flight requests for a given user
Expand Down Expand Up @@ -113,7 +113,7 @@ export const getFlightRequestById = async (req: Request, res: Response) => {

const base = new Airtable({
apiKey: process.env.AIRTABLE_API_KEY || '',
}).base('appwPsfAb6U8CV3mf');
}).base(process.env.AIRTABLE_BASE_ID || '');

try {
await base('Flight Requests (Trips)').find(
Expand Down Expand Up @@ -148,7 +148,7 @@ export const getFlightLegsById = async (req: Request, res: Response) => {

const base = new Airtable({
apiKey: process.env.AIRTABLE_API_KEY || '',
}).base('appwPsfAb6U8CV3mf');
}).base(process.env.AIRTABLE_BASE_ID || '');

try {
flightLegs = await base('Flight Legs')
Expand Down
8 changes: 4 additions & 4 deletions src/controllers/Passenger.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ dotenv.config();

const base = new Airtable({
apiKey: process.env.AIRTABLE_API_KEY || '',
}).base('appwPsfAb6U8CV3mf');
}).base(process.env.AIRTABLE_BASE_ID || '');

/**
* Get all of the related passengers for a user (people they have flown with in the past)
Expand All @@ -29,7 +29,7 @@ export const getAllPassengersForUser = async (req: Request, res: Response) => {

const base = new Airtable({
apiKey: process.env.AIRTABLE_API_KEY || '',
}).base('appwPsfAb6U8CV3mf');
}).base(process.env.AIRTABLE_BASE_ID || '');

try {
// make a call to AirTable to get all passengers for the user
Expand Down Expand Up @@ -93,7 +93,7 @@ export const getPassengerById = async (req: Request, res: Response) => {

const base = new Airtable({
apiKey: process.env.AIRTABLE_API_KEY || '',
}).base('appwPsfAb6U8CV3mf');
}).base(process.env.AIRTABLE_BASE_ID || '');

try {
await base('Passengers').find(
Expand Down Expand Up @@ -308,7 +308,7 @@ export const updatePassenger = async (req: Request, res: Response) => {

const base = new Airtable({
apiKey: process.env.AIRTABLE_API_KEY || '',
}).base('appwPsfAb6U8CV3mf');
}).base(process.env.AIRTABLE_BASE_ID || '');

try {
// make a call to AirTable to update the passenger
Expand Down
2 changes: 1 addition & 1 deletion src/controllers/User.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export const createUser = async (req: WithAuthProp<Request>, res: Response) => {

const base = new Airtable({
apiKey: process.env.AIRTABLE_API_KEY || '',
}).base('appwPsfAb6U8CV3mf');
}).base(process.env.AIRTABLE_BASE_ID || '');

const passenger = await base('Passengers')
.select({
Expand Down

0 comments on commit 656a37f

Please sign in to comment.