Skip to content

Commit 6405353

Browse files
refactor: add type to http fetch function
1 parent 60138f8 commit 6405353

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/app/services/github.service.ts

+6-2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { Injectable } from "@angular/core";
22
import { HttpClient } from "@angular/common/http";
33
import { Observable } from "rxjs";
44
import { map } from "rxjs/operators";
5+
import { Repo } from "../pages/user-search/models/repo";
56

67
@Injectable({
78
providedIn: "root",
@@ -18,7 +19,10 @@ export class GithubService {
1819
})
1920
);
2021
} */
21-
getRepos(username: string) {
22-
return this.http.get(`https://api.github.com/users/${username}/repos`);
22+
getRepos(username: string): Observable<any> {
23+
const returns = this.http.get(`https://api.github.com/users/${username}/repos`);
24+
console.log(returns.subscribe((x) => console.log(x)));
25+
console.log('returns type', typeof(returns));
26+
return returns;
2327
}
2428
}

0 commit comments

Comments
 (0)