From ad9e39fb815d85e5e718c40540fa75471474fa17 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Fri, 25 May 2018 09:57:16 +0200 Subject: [PATCH] Only use account name in routes --- .../account-video-channels.component.ts | 2 +- .../my-account-video-channels.component.ts | 2 +- .../video-channels.component.html | 2 +- client/src/app/menu/menu.component.html | 2 +- .../src/app/shared/account/account.model.ts | 2 + client/src/app/shared/users/user.model.ts | 21 +- .../video-channel/video-channel.service.ts | 5 +- .../app/shared/video/video-details.model.ts | 4 +- .../video/video-miniature.component.html | 4 +- client/src/app/shared/video/video.service.ts | 2 +- .../+video-edit/video-update.component.ts | 2 +- .../+video-watch/video-watch.component.html | 2 +- server/controllers/api/accounts.ts | 12 +- server/controllers/services.ts | 2 +- server/helpers/custom-validators/accounts.ts | 3 +- server/middlewares/validators/account.ts | 32 +-- .../middlewares/validators/video-channels.ts | 6 +- server/tests/api/check-params/accounts.ts | 4 +- .../tests/api/check-params/video-channels.ts | 10 +- server/tests/api/check-params/videos.ts | 6 +- .../tests/api/users/users-multiple-servers.ts | 15 +- server/tests/api/videos/video-channels.ts | 5 +- server/tests/api/videos/video-nsfw.ts | 6 +- server/tests/utils/users/accounts.ts | 4 +- server/tests/utils/videos/video-channels.ts | 4 +- server/tests/utils/videos/videos.ts | 4 +- support/doc/api/html/index.html | 262 +++++++++++++++++- support/doc/api/openapi.yaml | 18 +- 28 files changed, 333 insertions(+), 110 deletions(-) diff --git a/client/src/app/+accounts/account-video-channels/account-video-channels.component.ts b/client/src/app/+accounts/account-video-channels/account-video-channels.component.ts index 0852c4bb7..a6e6dd656 100644 --- a/client/src/app/+accounts/account-video-channels/account-video-channels.component.ts +++ b/client/src/app/+accounts/account-video-channels/account-video-channels.component.ts @@ -26,7 +26,7 @@ export class AccountVideoChannelsComponent implements OnInit { this.accountService.accountLoaded .pipe( tap(account => this.account = account), - flatMap(account => this.videoChannelService.listAccountVideoChannels(account.id)), + flatMap(account => this.videoChannelService.listAccountVideoChannels(account)), map(res => res.data) ) .subscribe(videoChannels => this.videoChannels = videoChannels) diff --git a/client/src/app/+my-account/my-account-video-channels/my-account-video-channels.component.ts b/client/src/app/+my-account/my-account-video-channels/my-account-video-channels.component.ts index 7abf48826..20c8798d1 100644 --- a/client/src/app/+my-account/my-account-video-channels/my-account-video-channels.component.ts +++ b/client/src/app/+my-account/my-account-video-channels/my-account-video-channels.component.ts @@ -52,7 +52,7 @@ export class MyAccountVideoChannelsComponent implements OnInit { private loadVideoChannels () { this.authService.userInformationLoaded - .pipe(flatMap(() => this.videoChannelService.listAccountVideoChannels(this.user.account.id))) + .pipe(flatMap(() => this.videoChannelService.listAccountVideoChannels(this.user.account))) .subscribe(res => this.videoChannels = res.data) } } diff --git a/client/src/app/+video-channels/video-channels.component.html b/client/src/app/+video-channels/video-channels.component.html index da0d76acf..6b25d16ab 100644 --- a/client/src/app/+video-channels/video-channels.component.html +++ b/client/src/app/+video-channels/video-channels.component.html @@ -10,7 +10,7 @@
{{ videoChannel.followersCount }} subscribers
- + Created by {{ videoChannel.ownerBy }} Owner account avatar diff --git a/client/src/app/menu/menu.component.html b/client/src/app/menu/menu.component.html index 6a2a495a2..1a95477b7 100644 --- a/client/src/app/menu/menu.component.html +++ b/client/src/app/menu/menu.component.html @@ -14,7 +14,7 @@