i have this function in my service, the articleId and Type are optionnal because not every article have one but it's never reach the else section and the type is assign to the articleId so i get an error Code: 400
getArticles(name: string, articleId?: string, Type?:Code) {
if(name && articleId) {
return this.http.get(environment.api + '?name=' + name + '&articleId=' + articleId);
}
else{
return this.http.get(environment.api + '?name=' + name + '&Type=' + Type);
}
}
did someone can help to fix this error please