Coder Social home page Coder Social logo

Comments (5)

ndimatteo avatar ndimatteo commented on May 24, 2024 1

@raqibnur please open a separate issue with more details about what you are experiencing, instead of commenting on other people's issues that are still open 🤘

from hull.

ansmlc avatar ansmlc commented on May 24, 2024

I've managed to "remove" one of the duplicate products by hardcoding its ID to product-delete.js API:
stx = stx.patch('product-${specific-id}', (patch) => patch.set({ wasDeleted: true }))

The product is now marked as "removed" in Sanity but the document is still there, and still giving the same "slug in use" warning:
image

Because of this slug conflict error the client still can't publish the proper product.

Any idea what other patch or mutation would perhaps be more useful?

from hull.

ndimatteo avatar ndimatteo commented on May 24, 2024

Hey there @ansmlc by default Sanity checks for uniqueness on slug fields for documents.

This is why it's not updating anything in Sanity when the sync function occurs. You can actually see the error message after the sync starts in your first screenshot:

Screenshot 2022-12-28 at 4 18 02 PM

You'll need to either delete the previous documents (and remove all references to those elsewhere first), or you can try overriding the default validation for the product slug fields in your schema to allow it to create product documents with the same slug values.

Let me know if that helps! 🤘

from hull.

raqibnur avatar raqibnur commented on May 24, 2024

is there any way to check the localhost sanity error log? mine is not syncing

from hull.

ansmlc avatar ansmlc commented on May 24, 2024

@ndimatteo This has been resolved by rolling back to an older dataset backup and avoiding having same-slug documents.

from hull.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.