mirror of
				https://codeberg.org/yeentown/barkey.git
				synced 2025-11-04 07:24:13 +00:00 
			
		
		
		
	This commit is contained in:
		
							parent
							
								
									16f483d273
								
							
						
					
					
						commit
						c38f04fe38
					
				
					 3 changed files with 11 additions and 9 deletions
				
			
		| 
						 | 
					@ -145,22 +145,22 @@ export class ApiAccountMastodon {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	public async getBookmarks() {
 | 
						public async getBookmarks() {
 | 
				
			||||||
		const data = await this.client.getBookmarks(parseTimelineArgs(this.request.query));
 | 
							const data = await this.client.getBookmarks(parseTimelineArgs(this.request.query));
 | 
				
			||||||
		return data.data.map((status) => this.mastoConverters.convertStatus(status));
 | 
							return Promise.all(data.data.map((status) => this.mastoConverters.convertStatus(status)));
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	public async getFavourites() {
 | 
						public async getFavourites() {
 | 
				
			||||||
		const data = await this.client.getFavourites(parseTimelineArgs(this.request.query));
 | 
							const data = await this.client.getFavourites(parseTimelineArgs(this.request.query));
 | 
				
			||||||
		return data.data.map((status) => this.mastoConverters.convertStatus(status));
 | 
							return Promise.all(data.data.map((status) => this.mastoConverters.convertStatus(status)));
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	public async getMutes() {
 | 
						public async getMutes() {
 | 
				
			||||||
		const data = await this.client.getMutes(parseTimelineArgs(this.request.query));
 | 
							const data = await this.client.getMutes(parseTimelineArgs(this.request.query));
 | 
				
			||||||
		return data.data.map((account) => this.mastoConverters.convertAccount(account));
 | 
							return Promise.all(data.data.map((account) => this.mastoConverters.convertAccount(account)));
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	public async getBlocks() {
 | 
						public async getBlocks() {
 | 
				
			||||||
		const data = await this.client.getBlocks(parseTimelineArgs(this.request.query));
 | 
							const data = await this.client.getBlocks(parseTimelineArgs(this.request.query));
 | 
				
			||||||
		return data.data.map((account) => this.mastoConverters.convertAccount(account));
 | 
							return Promise.all(data.data.map((account) => this.mastoConverters.convertAccount(account)));
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	public async acceptFollow() {
 | 
						public async acceptFollow() {
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -47,17 +47,18 @@ export class ApiSearchMastodon {
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	public async getStatusTrends() {
 | 
						public async getStatusTrends() {
 | 
				
			||||||
		return await fetch(`${this.BASE_URL}/api/notes/featured`,
 | 
							const data = await fetch(`${this.BASE_URL}/api/notes/featured`,
 | 
				
			||||||
			{
 | 
								{
 | 
				
			||||||
				method: 'POST',
 | 
									method: 'POST',
 | 
				
			||||||
				headers: {
 | 
									headers: {
 | 
				
			||||||
					'Accept': 'application/json',
 | 
										'Accept': 'application/json',
 | 
				
			||||||
					'Content-Type': 'application/json',
 | 
										'Content-Type': 'application/json',
 | 
				
			||||||
				},
 | 
									},
 | 
				
			||||||
				body: JSON.stringify({}),
 | 
									body: '{}',
 | 
				
			||||||
			})
 | 
								})
 | 
				
			||||||
			.then(res => res.json())
 | 
								.then(res => res.json() as Promise<Status[]>)
 | 
				
			||||||
			.then(data => data.map((status: Status) => this.mastoConverter.convertStatus(status)));
 | 
								.then(data => data.map(status => this.mastoConverter.convertStatus(status)));
 | 
				
			||||||
 | 
							return Promise.all(data);
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	public async getSuggestions() {
 | 
						public async getSuggestions() {
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -142,7 +142,8 @@ export class ApiTimelineMastodon {
 | 
				
			||||||
				const accessTokens = _request.headers.authorization;
 | 
									const accessTokens = _request.headers.authorization;
 | 
				
			||||||
				const client = getClient(BASE_URL, accessTokens);
 | 
									const client = getClient(BASE_URL, accessTokens);
 | 
				
			||||||
				const data = await client.getAccountsInList(_request.params.id, _request.query);
 | 
									const data = await client.getAccountsInList(_request.params.id, _request.query);
 | 
				
			||||||
				reply.send(data.data.map((account: Entity.Account) => this.mastoConverters.convertAccount(account)));
 | 
									const accounts = await Promise.all(data.data.map((account: Entity.Account) => this.mastoConverters.convertAccount(account)));
 | 
				
			||||||
 | 
									reply.send(accounts);
 | 
				
			||||||
			} catch (e) {
 | 
								} catch (e) {
 | 
				
			||||||
				const data = getErrorData(e);
 | 
									const data = getErrorData(e);
 | 
				
			||||||
				this.logger.error(`GET /v1/lists/${_request.params.id}/accounts`, data);
 | 
									this.logger.error(`GET /v1/lists/${_request.params.id}/accounts`, data);
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		
		Reference in a new issue