Wednesday, July 12, 2023

Setup Postman collection for Order cloud

Introduction

Postman collections are essential for API development as they facilitate testing, documentation, collaboration, automation, and security testing. They help ensure API reliability and performance while enabling efficient team collaboration.

Sitecore Order Cloud offers a default set of APIs.

Steps to setup and access

Go to this Sitecore Postman collection, Here is the link to access it - OrderCloud API Exercise 


Click "Run" in Postman, which will provide you with the option to open the Postman collection in either your browser or the Postman desktop application.

It's advisable to establish a Postman team collection that's specific to the project, allowing for easy modification and sharing within the team.

It's a good practice to setup a new space and do the source control all the key API's and collection so this can be shred withing the team



Key Benefits:

  • Improved collaboration and knowledge sharing
  • Version control for consistent API development
  • Reusable components for faster development
  • Centralized documentation for easy access

Practices:

  • Create a dedicated Postman workspace for APIs
  • Integrate source control to track and revert changes
  • Use consistent naming conventions for clarity
  • Encourage regular updates to reflect API changes
  • Implement code review for quality and consistency
  • Establish documentation standards for clarity


Friday, July 7, 2023

Sitecore Xm Cloud - Navigating React Hooks: Addressing useEffect Missing Dependency Warnings and Escaping Quotation Marks

 Recently I got below error while building and deploying the XM Cloud project





 +00:00|INFO|114:5  Warning: React Hook useEffect has a missing dependency: 'facets'. Either include it or remove the dependency array.  react-hooks/exhaustive-deps

39:13  Error: `"` can be escaped with `"`, `“`, `"`, `”`.  react/no-unescaped-entities

  Error: `"` can be escaped with `"`, `“`, `"`, `”`.  react/no-unescaped-entities


to fix this issue for temprary I disabled below settings.

 "@typescript-eslint/no-unused-vars": "off",
    "@typescript-eslint/no-explicit-any": "off",
    "react/no-unescaped-entities": "off",
    "@next/next/no-page-custom-font": "off",