Hardeepex / juicybabencmz

0 stars 0 forks source link

sweep: Fetch the data from Professional Custom Post type and show on faustjs frontend #1

Closed Hardeepex closed 9 months ago

Hardeepex commented 9 months ago

I have the custom post type professional in my wordpress website https://juicytalent.com, i am using graphql for fetching the data .

To fetch and display your custom post type professional, you can follow the same pattern used for posts in these files. You would need to:

  1. Create a GraphQL query for fetching professionals in fragments/queries.ts.
  2. Create a new component in src/container (similar to SingleType1 in single/single.tsx) that displays a single professional.
  3. Create a new template in wp-templates (similar to single.tsx) that fetches and displays a single professional page.

Remember to update the GraphQL fragments and queries as needed to fetch the correct fields for your professional custom post type.

import { gql } from "@/generated";

// ... other queries

export const GET_PROFESSIONALS = gql query GetProfessionals { professionals { nodes { title uri link content categories { nodes { name slug taxonomyName uri } } slug } } } ;

// ... other queries and mutations

Checklist - [X] Modify `src/fragments/queries.ts` ✓ https://github.com/Hardeepex/juicybabencmz/commit/ee6f579406b16920503baf572990c36c236dabd5 [Edit](https://github.com/Hardeepex/juicybabencmz/edit/sweep/fetch_the_data_from_professional_custom/src/fragments/queries.ts) - [X] Running GitHub Actions for `src/fragments/queries.ts` ✓ [Edit](https://github.com/Hardeepex/juicybabencmz/edit/sweep/fetch_the_data_from_professional_custom/src/fragments/queries.ts) - [X] Create `src/container/singles/single/SingleProfessional.tsx` ✓ https://github.com/Hardeepex/juicybabencmz/commit/341854e82f642393e07d701d0e3cd14b32adf797 [Edit](https://github.com/Hardeepex/juicybabencmz/edit/sweep/fetch_the_data_from_professional_custom/src/container/singles/single/SingleProfessional.tsx) - [X] Running GitHub Actions for `src/container/singles/single/SingleProfessional.tsx` ✓ [Edit](https://github.com/Hardeepex/juicybabencmz/edit/sweep/fetch_the_data_from_professional_custom/src/container/singles/single/SingleProfessional.tsx) - [X] Create `src/wp-templates/professional.tsx` ✓ https://github.com/Hardeepex/juicybabencmz/commit/802a289760d00af6d60209fa8493354d64fd084f [Edit](https://github.com/Hardeepex/juicybabencmz/edit/sweep/fetch_the_data_from_professional_custom/src/wp-templates/professional.tsx) - [X] Running GitHub Actions for `src/wp-templates/professional.tsx` ✓ [Edit](https://github.com/Hardeepex/juicybabencmz/edit/sweep/fetch_the_data_from_professional_custom/src/wp-templates/professional.tsx)
sweep-ai[bot] commented 9 months ago

🚀 Here's the PR! #4

See Sweep's progress at the progress dashboard!
💎 Sweep Pro: I'm using GPT-4. You have unlimited GPT-4 tickets. (tracking ID: 2786efd10a)
Install Sweep Configs: Pull Request

Actions (click)

Sandbox execution failed

The sandbox appears to be unavailable or down.


Step 1: 🔎 Searching

I found the following snippets in your repository. I will now analyze these snippets and come up with a plan.

Some code snippets I think are relevant in decreasing order of relevance (click to expand). If some file is missing from here, you can mention the path in the ticket description. https://github.com/Hardeepex/juicybabencmz/blob/59c554c0c59351a86d7a086273ce7da74532fabc/src/fragments/queries.ts#L213-L296 https://github.com/Hardeepex/juicybabencmz/blob/59c554c0c59351a86d7a086273ce7da74532fabc/public/lang/en.ts#L67-L125 https://github.com/Hardeepex/juicybabencmz/blob/59c554c0c59351a86d7a086273ce7da74532fabc/src/wp-templates/single.tsx#L1-L271 https://github.com/Hardeepex/juicybabencmz/blob/59c554c0c59351a86d7a086273ce7da74532fabc/src/container/singles/single/single.tsx#L1-L55
I also found the following external resources that might be helpful: **Summaries of links found in the content:** https://juicytalent.com: The page is about the website Juicytalent, which offers online language courses with professional tutors. The page provides information about finding a language tutor, scheduling lessons, and starting the learning journey. It highlights the benefits of learning a new language online, such as customized learning and expert help when needed. The page also includes success stories from previous students. Additionally, the page includes contact information and links to social media platforms. In relation to the problem, the page does not provide any relevant information or code snippets about fetching and displaying the custom post type "professional" using GraphQL.

Step 2: ⌨️ Coding

--- 
+++ 
@@ -211,6 +211,28 @@
   }
 `);

+export const GET_PROFESSIONALS = gql`
+  query GetProfessionals {
+    professionals {
+      nodes {
+        title
+        uri
+        link
+        content
+        categories {
+          nodes {
+            name
+            slug
+            taxonomyName
+            uri
+          }
+        }
+        slug
+      }
+    }
+  }
+`;
+
 export const QUERY_MUTATION_DELETE_COMMENT_BY_ID = gql(/* GraphQL */ `
   mutation MutationDeleteCommentById($id: ID = "") {
     deleteComment(input: { id: $id }) {

Ran GitHub Actions for ee6f579406b16920503baf572990c36c236dabd5:

Ran GitHub Actions for 341854e82f642393e07d701d0e3cd14b32adf797:

Ran GitHub Actions for 802a289760d00af6d60209fa8493354d64fd084f:


Step 3: 🔁 Code Review

I have finished reviewing the code for completeness. I did not find errors for sweep/fetch_the_data_from_professional_custom.


🎉 Latest improvements to Sweep:


💡 To recreate the pull request edit the issue title or description. To tweak the pull request, leave a comment on the pull request. Join Our Discord

Hardeepex commented 9 months ago

sweep: is there any other file where we have to update about this professional custom post type in codebase in this repo and if not please start the designing process with tailwind i need simple card type design with tailwind