Coder Social home page Coder Social logo

Comments (6)

Khaledgarbaya avatar Khaledgarbaya commented on August 16, 2024

Hi @felixjung, the thing is some contentTypes may or may not have an editor interface. The bug here is that I forgot to set response.editorInterfaces to [] if the length is 0, I will push a fix right away

from contentful-batch-libs.

Khaledgarbaya avatar Khaledgarbaya commented on August 16, 2024

here is the commit : 35ee3f3

from contentful-batch-libs.

felixjung avatar felixjung commented on August 16, 2024

Hm yeah, I understand that. My point was just that instead of having any if clause at all, you could just run the .map call anyway. In code, I think

.then((response) => {
  if (response.contentTypes.length !== 0) {
    response.editorInterfaces = getEditorInterfaces(response.contentTypes)
    return Promise.props(response)
  }
  response.editorInterfaces = []
  return response
})

and this

.then((response) => {
  response.editorInterfaces = getEditorInterfaces(response.contentTypes)
  return Promise.props(response)
})

are essentially the same, because the call to getEditorInterfaces() will return a promise resolving to an empty array when response.contentTypes is [], anyway. If I'm right, that would be cleaner, no?

from contentful-batch-libs.

axe312ger avatar axe312ger commented on August 16, 2024

@felixjung I agree with u but since we will refactor the logic in there in the near future and the actual bug was fixed in last December, I will close this ticket for now.

from contentful-batch-libs.

iolloyd avatar iolloyd commented on August 16, 2024

Is this still going to be addressed in 'the near future'?

from contentful-batch-libs.

axe312ger avatar axe312ger commented on August 16, 2024

Is this still going to be addressed in 'the near future'?

Yes. Can't be more precise because there are high priorities at the moment, but that's very much on top of the list.

What are you missing @iolloyd? We are (sadly) no superheroes, every PR is welcome :)

from contentful-batch-libs.

Related Issues (13)

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.