mirror of
https://github.com/spacebarchat/server.git
synced 2026-07-13 02:59:07 +00:00
Clean up
This commit is contained in:
@@ -16,8 +16,8 @@
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import { route } from "@spacebar/api/util/handlers/route";
|
||||
import { Request, Response, Router } from "express";
|
||||
import { route } from "@spacebar/api/util/handlers/route";
|
||||
import { GifMediaTypes } from "@spacebar/schemas";
|
||||
import { GifProviderManager } from "@spacebar/util/util/integrations/gifProviders/GifProviderManager";
|
||||
|
||||
@@ -55,7 +55,7 @@ router.get(
|
||||
async (req: Request, res: Response) => {
|
||||
const { provider } = req.query;
|
||||
|
||||
const impl = GifProviderManager.getProvider(provider as string);
|
||||
const impl = GifProviderManager.getProvider((provider as string) ?? "tenor");
|
||||
const result = await impl.search(req.query as typeof impl.search.arguments);
|
||||
|
||||
res.json(result).status(200);
|
||||
|
||||
@@ -42,7 +42,7 @@ export default class TenorGifProvider implements IGifProvider {
|
||||
});
|
||||
|
||||
const { results } = (await response.json()) as { results: TenorGif[] };
|
||||
return results.map(parseGifResult);
|
||||
return results.map(this.convertGifResult);
|
||||
}
|
||||
|
||||
private convertGifResult(result: TenorGif) {
|
||||
|
||||
Reference in New Issue
Block a user