Skip to content

Commit cb5273d

Browse files
author
Juan José Vázquez
committed
wip gitlab: GetUserRepositories simplified
1 parent 18ba9e7 commit cb5273d

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

core/src/main/scala/Gitlab.scala

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,7 @@ object Gitlab {
4545
case GetRelease(slug: Slug, releaseId: ID, t: AccessToken) => ???
4646
case GetUserRepositories(t: AccessToken) =>
4747
def go(uri: String)(accum: List[Repo]): List[Repo] = {
48-
val EntityWithMeta(repos, pagination) = fetchWithMeta[List[Repo]](uri) { uri =>
49-
http4s.Request(
50-
headers = Headers(Header("PRIVATE-TOKEN", t.value)),
51-
uri = uri)
52-
}.run
48+
val EntityWithMeta(repos, pagination) = authFetchWithMeta[List[Repo]](uri, t).run
5349
val total = accum ++ repos
5450
pagination.nextPage.fold(total) { page =>
5551
val nextLink = pagination.links.getOrElse("next", cfg.repoEndpoint(page))
@@ -67,7 +63,6 @@ object Gitlab {
6763
private[this] def authFetch[A: EntityDecoder](uri: String, token: AccessToken): Task[A] =
6864
authFetchWithMeta(uri, token).map(_.entity)
6965

70-
7166
private[this] def authFetchWithMeta[A: EntityDecoder](uri: String, token: AccessToken): Task[EntityWithMeta[A]] =
7267
fetchWithMeta[A](uri) { uri =>
7368
http4s.Request(

0 commit comments

Comments
 (0)