{"id":78,"date":"2024-05-16T14:04:34","date_gmt":"2024-05-16T14:04:34","guid":{"rendered":"https:\/\/blogs.oregonstate.edu\/aicoder\/?p=78"},"modified":"2024-05-16T15:01:57","modified_gmt":"2024-05-16T15:01:57","slug":"michael-kozub-week-5","status":"publish","type":"post","link":"https:\/\/blogs.oregonstate.edu\/aicoder\/2024\/05\/16\/michael-kozub-week-5\/","title":{"rendered":"Michael Kozub &#8211; Week 5"},"content":{"rendered":"\n<p>This week I was able to use ChatGPT to help me create two buttons, Follow and Unfollow, one for each table in our user-home page: <strong>Users<\/strong> and <strong>Following<\/strong>. After the buttons were created, GPT struggled with adding new functions to the existing web page. I&#8217;m still learning how to write my queries to GPT but after an hour of struggling I had to revert to the old method &#8211; manual function creation. I was able to utilize some existing patterns our codebase has to create these new functions to add data to the &#8220;followers&#8221; table, as well as querying the data to update the tables in our web page.<\/p>\n\n\n\n<p>Overall, I got the followers table to show up to show who the user is following for the user who is logged in. I also got a new \u201cfollow\u201d button working that follows\/subscribes to a user in the user table. I added a placeholder &#8220;unfollow&#8221; button that I will work on next week. Below explains the features I implemented this week:<\/p>\n\n\n\n<p><strong>Feature: <\/strong>I added a &#8220;Follow&#8221; button to the Users table.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>When pressed, the new &#8220;Following table&#8221; that I created is populated with the users you follow (no page refresh needed).<\/li>\n\n\n\n<li>I also have an alert that pops up if you try to follow a user more than once (duplicate prevention).<\/li>\n\n\n\n<li>I added the subscriber\/publisher ids to the table just to be helpful for debugging and whatnot.<\/li>\n<\/ul>\n\n\n\n<p>Limitations\/known issues of this feature:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>The &#8220;follow&#8221; button is hard coded and does not dynamically update to show if you already follow that user. So even if you follow that user, it still says &#8220;follow&#8221;. I could look into doing a join next week to get that working dynamically if we want.<\/li>\n<\/ul>\n\n\n\n<p><strong>Feature:<\/strong> I also added a &#8220;unfollow&#8221; button on the &#8220;Following table&#8221;<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Doesn&#8217;t work quite yet but I do have an alert that says &#8220;coming soon&#8221; when it&#8217;s tapped. I will work on this functionality next week.<\/li>\n<\/ul>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"930\" src=\"https:\/\/osu-wams-blogs-uploads.s3.amazonaws.com\/blogs.dir\/7856\/files\/2024\/05\/following_table-1024x930.png\" alt=\"\" class=\"wp-image-80\" srcset=\"https:\/\/osu-wams-blogs-uploads.s3.amazonaws.com\/blogs.dir\/7856\/files\/2024\/05\/following_table-1024x930.png 1024w, https:\/\/osu-wams-blogs-uploads.s3.amazonaws.com\/blogs.dir\/7856\/files\/2024\/05\/following_table-300x273.png 300w, https:\/\/osu-wams-blogs-uploads.s3.amazonaws.com\/blogs.dir\/7856\/files\/2024\/05\/following_table-768x698.png 768w, https:\/\/osu-wams-blogs-uploads.s3.amazonaws.com\/blogs.dir\/7856\/files\/2024\/05\/following_table.png 1378w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>This week I was able to use ChatGPT to help me create two buttons, Follow and Unfollow, one for each table in our user-home page: Users and Following. After the buttons were created, GPT struggled with adding new functions to the existing web page. I&#8217;m still learning how to write my queries to GPT but [&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-78","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\/78","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=78"}],"version-history":[{"count":2,"href":"https:\/\/blogs.oregonstate.edu\/aicoder\/wp-json\/wp\/v2\/posts\/78\/revisions"}],"predecessor-version":[{"id":81,"href":"https:\/\/blogs.oregonstate.edu\/aicoder\/wp-json\/wp\/v2\/posts\/78\/revisions\/81"}],"wp:attachment":[{"href":"https:\/\/blogs.oregonstate.edu\/aicoder\/wp-json\/wp\/v2\/media?parent=78"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.oregonstate.edu\/aicoder\/wp-json\/wp\/v2\/categories?post=78"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.oregonstate.edu\/aicoder\/wp-json\/wp\/v2\/tags?post=78"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}