1
0
mirror of https://github.com/mgerb/go-discord-bot synced 2026-01-09 08:32:48 +00:00
Files
go-discord-bot/client/app/services/archive.service.ts
2022-03-29 00:35:45 -05:00

15 lines
469 B
TypeScript

import * as _ from 'lodash';
import { IVideoArchive } from '../model';
import { axios } from './axios.service';
export class ArchiveService {
public static async getVideoArchive(): Promise<IVideoArchive[]> {
const data = (await axios.get('/api/video-archive')).data.data;
return _.orderBy(data, 'created_at', ['desc']);
}
public static postVideoArchive(data: { url: string }): Promise<unknown> {
return axios.post('/api/video-archive', data);
}
}