thomasreichmann / upload-thomasar

Simple upload application for sharing files
https://upload-thomasar.vercel.app
0 stars 0 forks source link

"save files" that complete uploading to postgres and display them in fileList #18

Open thomasreichmann opened 2 days ago

thomasreichmann commented 2 days ago

after finishing the upload in here: https://github.com/thomasreichmann/upload-thomasar/blob/180d891f5e33faeb66dce5012eb5ec21b6287e3e/src/app/_hooks/useUpload.ts#L83-L93 we need to add a record to postgres for that user to then display that file in the list that currently is just mocked with a few random items https://github.com/thomasreichmann/upload-thomasar/blob/180d891f5e33faeb66dce5012eb5ec21b6287e3e/src/app/_components/files/fileList.tsx#L11-L17

thomasreichmann commented 2 days ago

we'll need to create a table in postgres for this, add a foreign key to the user for each file added to it and then fetch from that in the file list

thomasreichmann commented 2 days ago

for reloading the list after uploading we can just invalidate the query like we do for user updating in the settings mutation https://github.com/thomasreichmann/upload-thomasar/blob/180d891f5e33faeb66dce5012eb5ec21b6287e3e/src/app/_components/settings/settingsModal.tsx#L28-L30