Skip to content

Commit

Permalink
Fix yet more esl stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
Draikth committed Jul 25, 2024
1 parent 8915376 commit d7ebf1e
Showing 1 changed file with 27 additions and 27 deletions.
54 changes: 27 additions & 27 deletions database/imgQueries.ts
Original file line number Diff line number Diff line change
@@ -1,30 +1,30 @@
import { cache } from 'react';
import { sql } from './connect';
// import { cache } from 'react';
// import { sql } from './connect';

export type EvImage = {
id: number;
url: string;
};
// export type EvImage = {
// id: number;
// url: string;
// };

export const getImagesInsecure = cache(async () => {
return await sql<EvImage[]>`
SELECT
image_uploads.*
FROM
image_uploads
`;
});
// export const getImagesInsecure = cache(async () => {
// return await sql<EvImage[]>`
// SELECT
// image_uploads.*
// FROM
// image_uploads
// `;
// });

export const createImageInsecure = cache(async (url: string) => {
const [image] = await sql<EvImage[]>`
INSERT INTO
image_uploads (url)
VALUES
(
${url}
)
RETURNING
image_uploads.*
`;
return image;
});
// export const createImageInsecure = cache(async (url: string) => {
// const [image] = await sql<EvImage[]>`
// INSERT INTO
// image_uploads (url)
// VALUES
// (
// ${url}
// )
// RETURNING
// image_uploads.*
// `;
// return image;
// });

0 comments on commit d7ebf1e

Please sign in to comment.