-
-
Notifications
You must be signed in to change notification settings - Fork 283
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
chore: Override arguments in all services inheriting from templates #597
chore: Override arguments in all services inheriting from templates #597
Conversation
@jdalrymple what do you think of this approach? |
There might be a way just to override the types, but im not sure. |
Something like this: export interface MergeRequestNotes extends ResourceNotes {
all(
projectId: string | number,
mergeRequestsId: string | number,
options?: PaginatedRequestOptions,
);
}
export class MergeRequestNotes extends ResourceNotes {
constructor(options: BaseServiceOptions = {}) {
super('projects', 'merge_requests', options);
}
} |
fa37954
to
0472b88
Compare
0472b88
to
9f7e809
Compare
@jdalrymple changed as you've suggested to methods: So through this approach (I think):
Nervertheless, it seems okay to me 👍 |
Seems like a fair trade off to me. 👍 |
Im going to hold off a little bit before merging it. I feel like we might as well add the interfaces for all the services that extend templates |
sure. I can do that. no problem |
aff4354
to
88701b7
Compare
@jdalrymple, added interfaces for the child classes of the following templates:
|
@jdalrymple, Is there anything I can do to help finalize this merge-request? |
With all the freetime this week lol I should be able to merge this in ASAP! |
88701b7
to
5f6b20b
Compare
# [15.2.0](15.1.0...15.2.0) (2020-03-22) ### Features * **core:** Override arguments in all template children ([#597](#597)) ([d9c97d4](d9c97d4))
Problem - Code Readability
When using
![image](https://user-images.githubusercontent.com/9274567/74085691-a0576d00-4a73-11ea-8b70-1bfb80c465d0.png)
MergeRequestNotes
all
method it's not explicit what its parameters consist. The only thing we know is that it receives two parameters -> resourceId; and resource2Id.(just as depicted in the image bellow)
So here lies the problem, what really is resourceId and resource2Id, is it projectId and merge-requestId, or the other way around?
Solution Proposal