Giter Club home page Giter Club logo

Comments (5)

aldeed avatar aldeed commented on July 4, 2024

I guess the thing to decide here is: what would one expect a form like this to do? Since it's submitting to a method, autoform doesn't have any idea what you're going to do with the doc. Would we expect it to go ahead and upload all the files anyway, and call the method only after all the files are inserted and their IDs are added to doc? Is that what you were expecting?

I think as long as we document what use cases are supported, this could be technically possible. Maybe the method could pass back false or throw an error to tell cfs-autoform to cancel the uploads and delete the files, if the insert/update failed on the server.

from meteor-cfs-autoform.

dpankros avatar dpankros commented on July 4, 2024

Thanks for the reply. I have it working in my app and its been a relatively simple change that I will try to contribute back. I'll throw my changes into a branch and you can see if you want to integrate any of them.

Yes. Keep the behavior the same as it currently is. Upload the files and delete if there is a problem, just like it currently does.

As for the error cases, you can throw an Meteor.Error object in the server method and that will be presented later in the autoform "after" event. So knowing whether to rollback shouldn't be any more difficult than the client. At least, in my testing that seems to work fine. That is consistent with the client-only code as well so there are not a bunch of corner cases for testing.

BTW, I had to overcome bug #9 for this to work on my system so I already have the code to fix that for you.

from meteor-cfs-autoform.

aldeed avatar aldeed commented on July 4, 2024

Great @dpankros. I'm working on autoform fixes today and was hoping to fix these cfs-autoform issues after getting the next af release out, but I'm not sure whether I'll get to it today. Would like to see your PR, though if you've already solved a couple.

from meteor-cfs-autoform.

dpankros avatar dpankros commented on July 4, 2024

Pull request was sent for the updated code. I have not updated the readme.md to reflect the changes, however.

from meteor-cfs-autoform.

dpankros avatar dpankros commented on July 4, 2024

Changes were merged. Issue closed.

from meteor-cfs-autoform.

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.