#NotFound: The requested resource was not found. this issue i am facing

22 messages · Page 1 of 1 (latest)

elder scaffold
lost streamBOT
cunning sable
#

try adding the code in try-catch block

elder scaffold
#

i tried but same error repeating. i am using postgresql. i need to cofigure anything ?

cunning sable
#

try printing the id it might be getting null (doc.id )

#

try doc["id"]

magic sinew
#

would you mind splitting your code example and adding ts to your backticks?

elder scaffold
elder scaffold
magic sinew
#

and add ts to your backticks:

``ts

elder scaffold
#

i attach full snippet here

magic sinew
#

in your call, payload.findByID, you haven't specified which collection you wish to search on

elder scaffold
#

Same issue occur not resolved.

#

i am using afterChange hook

magic sinew
#

what happens when you try to access that resource with a classic rest call;

http://localhost:3000/api/uploads/[id]

elder scaffold
#

working fine when i hit the api. but in afterchange hook call the REST API or LOCAL API throw resource not found error

magic sinew
#

Have you tried breakpointing it?

fleet pewter
#

I think the database is not fast enough to insert the created payload doc.

  • I have afterChange create // e.g. on users
  • and want immediately update this doc // e.g. to add more data to this user
  • It only works if I add a timeout >5 seconds
magic sinew
#

@fleet pewter why not add the data in a beforeChange hook instead? That way you are modifying the data before it reaches the database

fleet pewter