Coder Social home page Coder Social logo

Fetch discussions from the API using `app.store.find()` with an array if ids just loads a page of 20 discussions about framework HOT 4 CLOSED

n-peugnet avatar n-peugnet commented on June 10, 2024
Fetch discussions from the API using `app.store.find()` with an array if ids just loads a page of 20 discussions

from framework.

Comments (4)

n-peugnet avatar n-peugnet commented on June 10, 2024

Sorry I just found out after filling this issue that this has already been reported in #1694, but it was closed in 2018 as "this is simply not implemented". As this function call is in the JS API docs since 1.0.0 I do consider this a bug.

from framework.

SychO9 avatar SychO9 commented on June 10, 2024

Hello,

This is not a bug, it just is/was never a feature to filter discussions by ID. The API docs aren't wrong either because depending on the model you're trying to find, the ID filter might be implemented in the backend, and if so, it would give you the right results.

Feel free to PR this feature however, the post model ID filter can be used as an example: https://github.com/flarum/framework/blob/0da069ba9fe0ba2c742998f5fc7a7cc94eeb239e/framework/core/src/Post/Filter/IdFilter.php - and if you do, don't forget an integration test ;) -

Gonna close as we are only keeping track of bugs here and features on the forum.

from framework.

n-peugnet avatar n-peugnet commented on June 10, 2024

Feel free to PR this feature however, the post model ID filter can be used as an example: https://github.com/flarum/framework/blob/0da069ba9fe0ba2c742998f5fc7a7cc94eeb239e/framework/core/src/Post/Filter/IdFilter.php - and if you do, don't forget an integration test ;) -

Thank you for the hint. I must admit that I searched how to add this filter but was kind of lost in all the different classes involved.

I will probably try to add this feature soon™.

from framework.

n-peugnet avatar n-peugnet commented on June 10, 2024

Maybe adding a comment in the JS API docs that warns about this filter being possibly not implemented depending on the Model could be more explicit? I suspect that other Models than Discussion's one are also affected by this issue.

from framework.

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.