Skip to content

Commit

Permalink
Save pad title when creating it
Browse files Browse the repository at this point in the history
This will allow us to use the pad title in the url of the pad instead of
the id, but still be able to identify it with the id.
  • Loading branch information
Ana06 committed Jul 13, 2018
1 parent 5c78a93 commit c20f237
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/app/components/home/home.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,10 @@ export class HomeComponent implements OnInit, OnDestroy {
}

launchPad() {
this.swellService.getObject(this.padid.value)
let name = this.padid.value;
this.swellService.getObject(name)
.then( object => {
this.swellService.setObjectName(object.id, name)
this.router.navigate(['/pad', object.id]);
})
.catch( err => {
Expand Down
8 changes: 8 additions & 0 deletions src/app/services/swell.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,14 @@ export class SwellService {
});
}

setObjectName(objectId, name) {
this.api.setObjectName(
{
id: objectId,
name: name
})
}


/**
* Propagate session info
Expand Down

0 comments on commit c20f237

Please sign in to comment.