{"id":92,"date":"2024-05-23T13:43:04","date_gmt":"2024-05-23T13:43:04","guid":{"rendered":"https:\/\/blogs.oregonstate.edu\/aicoder\/?p=92"},"modified":"2024-05-23T13:43:04","modified_gmt":"2024-05-23T13:43:04","slug":"michael-kozub-week-6","status":"publish","type":"post","link":"https:\/\/blogs.oregonstate.edu\/aicoder\/2024\/05\/23\/michael-kozub-week-6\/","title":{"rendered":"Michael Kozub &#8211; Week 6"},"content":{"rendered":"\n<p>This week I got the \u201cunfollow\u201d button working on the Followers table. While I was at it, I was working on trying to get the \u201cfollow\u201d button to disappear on the Users table so that nobody could try to follow a given user more than once. After doing some research, it seemed like the best plan of action would be to only have a user show up in the Users table or the Followers table, but not both. So I had to spend some time trying to get ChatGPT to help me write a join query or a subquery to filter out the users you already follow and exclude them from the Users table. I was able to get this functionality working: When the logged in user follows someone, they are removed from their Users table but appear in the Followers table. If they unfollow a given user, they are removed from the Followers table and appear back in the Users table.<\/p>\n\n\n\n<p>ChatGPT was helpful in getting me onto the right path thinking about a sub query to filter out followed users we don\u2019t want to show up in the Users table. I had to spend some time crafting my question\/query to ChatGPT to get this right, but I wasn\u2019t able to fully achieve it without an understanding of queries because I had to make some manual adjustments to get it working correctly.<\/p>\n\n\n\n<p>Up next: I noticed we have a few asynchronous callouts and on the frontend, it\u2019s not clear if we are waiting on something to happen or not. The next feature I\u2019d want to implement is adding a loading icon or a spinner to all async calls to let the user know something is happening and they\u2019ll know they are waiting on an action to be completed.<\/p>\n\n\n\n<p>Link to PR:\u00a0<a href=\"https:\/\/github.com\/aicoders-osu\/osu_467_aicoder\/pull\/23\">https:\/\/github.com\/aicoders-osu\/osu_467_aicoder\/pull\/23<\/a><\/p>\n\n\n\n<p>The below screenshot shows an example of what I got working. You will notice Harry Potter, Kevin Test1, test Kozub, and Test Testing do not show up in the top &#8220;User Table&#8221; but they show up in the &#8220;Following table&#8221;.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"682\" height=\"1024\" src=\"https:\/\/osu-wams-blogs-uploads.s3.amazonaws.com\/blogs.dir\/7856\/files\/2024\/05\/Screenshot-2024-05-23-at-7.41.34\u202fAM-682x1024.png\" alt=\"\" class=\"wp-image-93\" srcset=\"https:\/\/osu-wams-blogs-uploads.s3.amazonaws.com\/blogs.dir\/7856\/files\/2024\/05\/Screenshot-2024-05-23-at-7.41.34\u202fAM-682x1024.png 682w, https:\/\/osu-wams-blogs-uploads.s3.amazonaws.com\/blogs.dir\/7856\/files\/2024\/05\/Screenshot-2024-05-23-at-7.41.34\u202fAM-200x300.png 200w, https:\/\/osu-wams-blogs-uploads.s3.amazonaws.com\/blogs.dir\/7856\/files\/2024\/05\/Screenshot-2024-05-23-at-7.41.34\u202fAM-768x1153.png 768w, https:\/\/osu-wams-blogs-uploads.s3.amazonaws.com\/blogs.dir\/7856\/files\/2024\/05\/Screenshot-2024-05-23-at-7.41.34\u202fAM.png 918w\" sizes=\"auto, (max-width: 682px) 100vw, 682px\" \/><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>This week I got the \u201cunfollow\u201d button working on the Followers table. While I was at it, I was working on trying to get the \u201cfollow\u201d button to disappear on the Users table so that nobody could try to follow a given user more than once. After doing some research, it seemed like the best [&hellip;]<\/p>\n","protected":false},"author":14279,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[],"class_list":["post-92","post","type-post","status-publish","format-standard","hentry","category-project-progress-reports"],"_links":{"self":[{"href":"https:\/\/blogs.oregonstate.edu\/aicoder\/wp-json\/wp\/v2\/posts\/92","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blogs.oregonstate.edu\/aicoder\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blogs.oregonstate.edu\/aicoder\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blogs.oregonstate.edu\/aicoder\/wp-json\/wp\/v2\/users\/14279"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.oregonstate.edu\/aicoder\/wp-json\/wp\/v2\/comments?post=92"}],"version-history":[{"count":1,"href":"https:\/\/blogs.oregonstate.edu\/aicoder\/wp-json\/wp\/v2\/posts\/92\/revisions"}],"predecessor-version":[{"id":94,"href":"https:\/\/blogs.oregonstate.edu\/aicoder\/wp-json\/wp\/v2\/posts\/92\/revisions\/94"}],"wp:attachment":[{"href":"https:\/\/blogs.oregonstate.edu\/aicoder\/wp-json\/wp\/v2\/media?parent=92"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.oregonstate.edu\/aicoder\/wp-json\/wp\/v2\/categories?post=92"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.oregonstate.edu\/aicoder\/wp-json\/wp\/v2\/tags?post=92"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}