Information Security, Anonymous Message Board

Hi!

Does not pass the test 5.

// running tests
5. You can send a POST request to /api/threads/{board} with form data including text and delete_password. The saved database record will have at least the fields _id, text, created_on(date & time), bumped_on(date & time, starts same as created_on), reported (boolean), delete_password, & replies (array).

At cloud.mongodb.com my collection(‘test’ ->‘threads’) after running the test two objects were added:

_id 6746dcbcf1e8965d738bab57
board “fcc_test”
text “fcc_test_Wed Nov 27 2024 12:47:56 GMT+0400 (Standard Time)”
reported false
delete_password “delete_me”

replies Array (empty)
created_on 2024-11-27T08:47:56.275+00:00
bumped_on 2024-11-27T08:47:56.275+00:00
__v 0

_id 6746dcbcf1e8965d738bab59
board “fcc_test”
text “fcc_test_thread”
reported false
delete_password “delete_me”

replies Array (empty)
created_on 2024-11-27T08:47:56.921+00:00
bumped_on 2024-11-27T08:47:56.921+00:00
__v 0

Here is my code
https://leprecon73-boilerplatep-klxzfe8egje.ws-eu116.gitpod.io/

In each document(in mongodb). There are

_id,
text,
created_on(date & time),
bumped_on(date & time, starts same as created_on),
reported (boolean),
delete_password,
replies

but still fails the test

Please post a workspace snapshot, or GitHub repo.

POST method in /routes/api.js

I don’t think you can complete the POST tests without a GET route the test can use to check the POST was done correctly. Try implementing the GET on the same route path.

OK. Thank you for reply.