nss-day-cohort-46 / rare-server-groovy-goblins

rare-server-groovy-goblins created by GitHub Classroom
0 stars 2 forks source link

Cr add tag to post #67

Closed CheoR closed 3 years ago

CheoR commented 3 years ago

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,


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
    }

image

In SQL file, verify tag added to post.

SELECT * FROM PostTags;

Checklist: