Closed 2blo closed 1 year ago
undefined api key problem - client side query? - just make a trpc endpoint for it? do it on initial upload and store link in db to reduce nbr if calls?
trpc
listByUser
? initial upload --> db
initial audio track
the thumbnail urls are the same each time,
maxres
is not available: await axios.get(
https://i.ytimg.com/vi/lHngf-CKCzk/maxresdefault.jpg );
--> tRPC failed on post.listByUser: TRPCError: Request failed with status code 404
hqdefault
example res:
etho video:
thumbnails: {
default: {
url: 'https://i.ytimg.com/vi/lHngf-CKCzk/default.jpg',
width: 120,
height: 90
},
medium: {
url: 'https://i.ytimg.com/vi/lHngf-CKCzk/mqdefault.jpg',
width: 320,
height: 180
},
high: {
url: 'https://i.ytimg.com/vi/lHngf-CKCzk/hqdefault.jpg',
width: 480,
height: 360
}
},
terminal:
thumbnails: {
default: {
url: 'https://i.ytimg.com/vi/gFcDolkdB9A/default.jpg',
width: 120,
height: 90
},
medium: {
url: 'https://i.ytimg.com/vi/gFcDolkdB9A/mqdefault.jpg',
width: 320,
height: 180
},
high: {
url: 'https://i.ytimg.com/vi/gFcDolkdB9A/hqdefault.jpg',
width: 480,
height: 360
},
standard: {
url: 'https://i.ytimg.com/vi/gFcDolkdB9A/sddefault.jpg',
width: 640,
height: 480
},
maxres: {
url: 'https://i.ytimg.com/vi/gFcDolkdB9A/maxresdefault.jpg',
width: 1280,
height: 720
}
},
undefined user id "dont use isReady
to conditionally render on server"
wanted behavior:
trpc with ssprops id should be undefined, fir SEO
what about and post/index.js for SEO? I don't really want a general /post/
page
wrong id + isReady --> 404
trpc error + not ready --> placeholder
empty id trpc error
ssr for trpc:
fuck it, the error only appears in dev anyway
conclusion
await
; await ctx.prisma.post.delete({...
invalidate does not work as it should yet: "If the query is currently being rendered via useQuery or related hooks, it will also be refetched in the background"
data
from onsuccess
to delete the correct object, but it is not super pretty, and we should refetch anyway, especially if you delete from inside the post view. you can make a reusable onsuccess hookoptimistic update
worked by calling all2.refetch();
in onsuccess
setOpen + delete
to onClick
solution: put modal as variable in dropdown to access state.
Needed for debugging prod etc
out of scope