Created
December 1, 2021 00:57
-
-
Save aleksejkozin/506c4a21321769fbb81efa0e282d3e82 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const {Pool} = require('pg') | |
const app = express() | |
const pool = new Pool({ | |
// confing | |
}) | |
app.get('/submissions', requiresAuth(), async (req, res) => { | |
const {rows} = await pool.query( | |
` | |
SELECT * | |
FROM submissions | |
WHERE created_by = $1 | |
ORDER BY updated DESC | |
`, | |
[req?.oidc?.user?.email], | |
) | |
res.json(rows) | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment