INSERT INTO Posts ("user_id", "category_id", "title", "publication_date", "image_url", "content", "approved" )
VALUES(1, 1,'title 1',DATETIME(),"", 'post 1',true);
INSERT INTO Tags ('label') VALUES('TESTINGS1');
-- GET THEIR POST AND TAG ID FROM THEIR TABLES
SELECT * FROM Posts;
SELECT * FROM Tags;
-- CONFIRM TAGS ALREADY ASSIGNED TO POSTS
SELECT * FROM PostTags;
In Postman'sPOST tab, select body -> raw and add the following to the body:
{
"post_id": LAST POST ID,
"tag_id": LAST TAB ID
}
In SQL file, verify tag added to post.
SELECT * FROM PostTags;
Checklist:
[X] My code follows the style guidelines of this project
[X] I have performed a self-review of my own code
[X] I have commented my code, particularly in hard-to-understand areas
[X] My changes generate no new warnings or errors
[X] I have added test instructions that prove my fix is effective or that my feature works
Description
While there is no post detail, user can only add tag to post through Postman.
Closes #10
Type of change
Testing Instructions
While there is no post detail, user can only add tag to post through Postman.
git fetch --all
git checkout cr-add-tag-to-post
watchgod request_handler.main
In
SQL
file run,In Postman's
POST
tab, selectbody
->raw
and add the following to the body:In
SQL
file, verify tag added to post.Checklist: