Skip to content

Let's use AI to Earn!

fix(internal): add endpoint to retrieve account information by account (#242)

nevindd2d8cf19203
diff --git a/project/backend/apps/aitoearn-server/src/internal/account.controller.ts b/project/backend/apps/aitoearn-server/src/internal/account.controller.ts
index ce6d2df1..02227a37 100644
--- a/project/backend/apps/aitoearn-server/src/internal/account.controller.ts
+++ b/project/backend/apps/aitoearn-server/src/internal/account.controller.ts
@@ -26,6 +26,15 @@ export class AccountController {
private readonly accountGroupService: AccountGroupService,
) { }
+ @Get('socials/account/:accountId')
+ async getAccountInfo(
+ @Param('accountId') accountId: string,
+ ) {
+ return await this.accountInternalService.getAccountInfo(
+ accountId,
+ )
+ }
+
@ApiDoc({
summary: 'Create Social Media Account',
body: CreateAccountDto.schema,
diff --git a/project/backend/apps/aitoearn-server/src/internal/provider/account.service.ts b/project/backend/apps/aitoearn-server/src/internal/provider/account.service.ts
index d77f9a99..4792b373 100644
--- a/project/backend/apps/aitoearn-server/src/internal/provider/account.service.ts
+++ b/project/backend/apps/aitoearn-server/src/internal/provider/account.service.ts
@@ -9,6 +9,10 @@ export class AccountInternalService {
private readonly accountService: AccountService,
) { }
+ async getAccountInfo(accountId: string) {
+ return await this.accountService.getAccountById(accountId)
+ }
+
async createSocialMediaAccount(userId: string, body: CreateAccountDto) {
return await this.accountService.addAccount(userId, {
...body,