Skip to content

Commit

Permalink
chore: improvements on mongodb integration for jms #447
Browse files Browse the repository at this point in the history
  • Loading branch information
svendjanis committed Dec 4, 2022
1 parent 4f1ed26 commit c9337ce
Show file tree
Hide file tree
Showing 6 changed files with 6,805 additions and 4,408 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,12 @@ export class MongoDatabaseService extends DbService {
}

setDocument(moduleId, id, data) {
if (this.router.url.includes('new')) {
return this.http.post<any>(`/api/document/${moduleId}`, data)
console.log(id);
console.log(this.router.url);
if (this.router.url.includes('new') || this.router.url.includes('/m/users')) {
return this.http.post<any>(`/api/document/${moduleId}`, data);
} else {
return this.http.put<any>(`/api/document/${moduleId}/${id}`, data)
return this.http.put<any>(`/api/document/${moduleId}/${id}`, data);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ export class UserAddComponent implements OnInit {
{
createdOn: Date.now(),
role: data.role,
email: data.email,
requireReset: data.requireReset,
sendInvite: type === 'invite',
createdBy: this.state.user.id
Expand Down
Loading

0 comments on commit c9337ce

Please sign in to comment.