Skip to content

Commit

Permalink
fix: Fix v1.accounts.create content-type and return type
Browse files Browse the repository at this point in the history
  • Loading branch information
neet committed Jan 11, 2023
1 parent 8286710 commit 3d083f5
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions src/mastodon/v1/repositories/account-repository.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import type {
List,
Relationship,
Status,
Token,
} from '../entities';
import type { FamiliarFollowers } from '../entities/familiar-followers';

Expand Down Expand Up @@ -99,9 +100,9 @@ export interface LookupAccountParams {
readonly acct: string;
}

export class AccountRepository
implements Repository<Account, CreateAccountParams>
{
// implements Repository<Account, CreateAccountParams>

export class AccountRepository {
constructor(
private readonly http: Http,
readonly config: MastoConfig,
Expand All @@ -125,11 +126,13 @@ export class AccountRepository
* and should wait for the user to confirm their account by clicking a link in their email inbox.
* @param params Parameters
* @return Token
* @see https://docs.joinmastodon.org/methods/accounts/
* @see https://docs.joinmastodon.org/methods/accounts/#create
*/
@version({ since: '2.7.0' })
create(params: CreateAccountParams): Promise<Account> {
return this.http.post(`/api/v1/accounts`, params);
create(params: CreateAccountParams): Promise<Token> {
return this.http.post(`/api/v1/accounts`, params, {
headers: { 'Content-Type': 'multipart/form-data' },
});
}

/**
Expand Down

0 comments on commit 3d083f5

Please sign in to comment.