diagnosing problem with session storage

This commit is contained in:
Mikayla Dobson
2023-01-13 21:26:56 -06:00
parent 3831f110a3
commit 7aa5e80d4d
20 changed files with 181 additions and 109 deletions

View File

@@ -7,7 +7,7 @@ import { CtlResponse } from "../util/types";
const CollectionInstance = new CollectionCtl();
export class Recipe {
async getOneByID(id: string) {
async getOneByID(id: number) {
try {
const statement = `SELECT * FROM recipin.recipe WHERE id = $1`;
const values = [id];
@@ -19,7 +19,7 @@ export class Recipe {
}
}
async getAllAuthored(id: string) {
async getAllAuthored(id: number) {
try {
const statement = `SELECT * FROM recipin.recipe WHERE authoruserid = $1`;
const result = await pool.query(statement, [id]);
@@ -30,7 +30,7 @@ export class Recipe {
}
}
async getAllAccessible(id: string) {
async getAllAccessible(id: number) {
try {
const statement = `
SELECT * FROM recipin.recipe
@@ -51,7 +51,7 @@ export class Recipe {
}
}
async fetchRecipesByCollection(collectionid: string) {
async fetchRecipesByCollection(collectionid: number) {
try {
} catch (e: any) {
@@ -59,7 +59,7 @@ export class Recipe {
}
}
async updateOneByID(id: string, data: IRecipe) {
async updateOneByID(id: number, data: IRecipe) {
const { name, description, preptime } = data;
try {
const statement = `
@@ -79,7 +79,7 @@ export class Recipe {
}
}
async post(userid: string, data: IRecipe) {
async post(userid: number, data: IRecipe) {
const { name, description, preptime } = data;
try {