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

finished change #18

Merged
merged 1 commit into from
Oct 20, 2024
Merged
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
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
Loading