[] means has an attribute (of whatever is inside the [])
cartDialog.open = !cartDialog.open (this sets the cartDialog.open property to the opposite of what it currently is, replaces long if/else statement)
Sanity - Getting Data into Sanity
Sanity is a CMS (content management system) - allows non-developers to update contents easily
The goal of our final project is to e able to store everything in the CMS
To install sanity:
npm install -g @sanity/cli OR yarn global add @sanity/cli
sanity init (set up a place to store CM contents inside an existing project’s repository)
Sanity start - serve up user interface at localhost:3333
Go into schema.js to tell sanity what kind of information you want to store (which depends on what your application is about)
Once this is set up, we can add category images using the CMS directly
Note that for our final project, all products will continue to be stored in stripe, and categories will be stored using sanity, they will need to be manually linked by setting their category names the same (at RBI, all product info and category info are saved on sanity)
Sanity - Moving things OUT of Sanity
Sanity uses GraphQL API (request specifically what information you want, and the API will return this information)
In the terminal: sanity graphql deploy to enable GraphQL playground
Morning Exercise
Sanity - Getting Data into Sanity
Sanity - Moving things OUT of Sanity