-
Notifications
You must be signed in to change notification settings - Fork 1
Feat/members actions #25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
crutan
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The create modal is not working at the moment.
| @@ -1,14 +1,22 @@ | |||
| <h2 mat-dialog-title class="text-3xl font-extrabold capitalize leading-7 tracking-tight sm:leading-10 md:text-4xl">Edit Member</h2> | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is always 'Edit', even when the form is blank for the invite member action.
| fn() | ||
| } | ||
|
|
||
| createMember() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because this is called from outside the form in the modal, it can't read from the form. I get an error in console:
hook.js:608 ERROR TypeError: Cannot read properties of undefined (reading 'form')
at createMember (form-modal.component.ts:100:83)
at _FormModalComponent.onSubmit (form-modal.component.ts:95:5)
at FormModalComponent_Template_button_click_37_listener (form-modal.component.html:53:56)
I think if you either use an [ngSubmit] in the form definition, or use arrow notation here, it will work.
| * Create user | ||
| */ | ||
| createUser(orgId: number, params: CreateUserRequest): Observable<CurrentUser> { | ||
| return this._httpClient.post<CurrentUser>(`/api/v3/users/?organization_id=${orgId}`, params).pipe( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can't fully test this because the create modal doesn't work, but I have a sneaking suspicion that a pipe without a subscribe won't actually fire off the httpClient request. But maybe it does with the subscribe in the modal ts? Like I said, I couldn't actually test it because the modal isn't working properly.
| .subscribe() | ||
| } | ||
|
|
||
| close(message: string) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you can just use dismiss here - right? Doesn't look like any of the functions that open the dialog are waiting for a return value from it.
Adds the members actions