Git Product home page Git Product logo

Comments (8)

stale avatar stale commented on July 25, 2024 1

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

from attachment-lite.

RomainLanz avatar RomainLanz commented on July 25, 2024 1

Closing in favor of the PR.

from attachment-lite.

hbatalhaStch avatar hbatalhaStch commented on July 25, 2024

@thetutlage I am facing the same issue? Any fix or workaround?

from attachment-lite.

aa-ndrej avatar aa-ndrej commented on July 25, 2024

@hbatalhaStch the workaround would be to just treat the save function as if it is not returning anything.

So instead of chaining model.save().otherMethod(); use model.save(); model.otherMethod();.
Or instead of returning return model.save() use model.save(); return model;

from attachment-lite.

hbatalhaStch avatar hbatalhaStch commented on July 25, 2024

@aa-ndrej thanks for the tip.

I have a question though: I am using the return of model.save() to check if save was successful, is this a good way? Is there a need to check if save was successful?

from attachment-lite.

aa-ndrej avatar aa-ndrej commented on July 25, 2024

@hbatalhaStch you can view the source code of the models save function if you navigate to node_modules/@adonisjs/lucid/build/src/Orm/BaseModel/index.js. I do not have that much experience with adonisjs but as far as I can see the function just returns return this;, so it is not really indicating that the model was successfully saved.
But I would assume that the save function would throw some kind of error otherwise.

from attachment-lite.

hbatalhaStch avatar hbatalhaStch commented on July 25, 2024

@aa-ndrej

you can view the source code of the models save function...

I already cloned the lucid repo to study to see if it throws somewhere

but as far as I can see the function just returns return this;

I am trying to see if any of the functions called above throws an error
@thetutlage would be helpful here.

Thanks

from attachment-lite.

RomainLanz avatar RomainLanz commented on July 25, 2024

Released as 1.0.8

from attachment-lite.

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.