trails icon indicating copy to clipboard operation
trails copied to clipboard

Footprints should add interface about using transaction when ORM is supported

Open jaumard opened this issue 7 years ago • 1 comments

Issue Description

Footprints should add interface about using transaction when ORM is supported. It can be nice to have something like this in order to use transaction with footprints. For example if I do :

return this.app.services.FootprintService.create('user', userInfos).then(user => {
      return this.app.services.FootprintService.createAssociation('user', user.id, 'passports', {
        protocol: 'local',
        password: password
      }).then(passport => Promise.resolve(user))
    })

User get created even if association failed so for now my only solution is to manually destroy the user if something go wrong...

It will be nice to have this for the V2 ^^

Environment

  • node version: all
  • trails version: all
  • operating system: all

jaumard avatar Nov 13 '16 13:11 jaumard

V2 is out so maybe possible for v3 ? cc @tjwebb

jaumard avatar Jan 19 '17 08:01 jaumard