Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add collection and category endpoints to store #7155

Merged
merged 2 commits into from May 1, 2024

Conversation

sradevski
Copy link
Member

No description provided.

Copy link

changeset-bot bot commented Apr 26, 2024

⚠️ No Changeset found

Latest commit: 6f003f8

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link

vercel bot commented Apr 26, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
api-reference 🔄 Building (Inspect) Visit Preview Apr 30, 2024 3:19pm
medusa-dashboard ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 30, 2024 3:19pm
2 Ignored Deployments
Name Status Preview Comments Updated (UTC)
docs-ui ⬜️ Ignored (Inspect) Visit Preview Apr 30, 2024 3:19pm
medusa-docs ⬜️ Ignored (Inspect) Visit Preview Apr 30, 2024 3:19pm

export type StoreGetCollectionsParamsType = z.infer<
typeof StoreGetCollectionsParams
>
export const StoreGetCollectionsParams = createFindParams({
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Once @riqwan merges his PR I'll clean these up to be shared across admin and storefront

remoteQueryObjectFromString,
} from "@medusajs/utils"

export const refetchCollection = async (
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similarly, once @riqwan merges the genric function I'll replace this one with it

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

these are free to use now in develop

@sradevski sradevski changed the title feat: Add collection endpoints to store feat: Add collection and category endpoints to store Apr 26, 2024
is_internal: true,
is_active: true,
rank: 0,
medusaIntegrationTestRunner({
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are still some tests that are failing, but I think we have some bugs in how product categories are handled. I'll investigate that separately, I want to focus on getting the storefront running first.

Copy link
Contributor

@riqwan riqwan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm!

remoteQueryObjectFromString,
} from "@medusajs/utils"

export const refetchCollection = async (
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

these are free to use now in develop

req.params.id,
req.scope,
req.remoteQueryConfig.fields,
req.filterableFields
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you can use idOrFilters for this when you rebase with refetchEntities

return categories[0]
}

export const applyCategoryFilters = (req, res, next) => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@riqwan I'll do a follow-up cleanup PR, I just want to get things merged before we do the v1 cleanup.

@sradevski sradevski merged commit ec37576 into develop May 1, 2024
24 checks passed
@sradevski sradevski deleted the feat/add-collections-endpoints-store branch May 1, 2024 08:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants