You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

21 lines
555 B

2 years ago
  1. import ApiService from '@/services/api.service'
  2. export class APIAuthRepository {
  3. constructor(private readonly request = ApiService) {}
  4. async login(username: string, password: string): Promise<void> {
  5. const url = `/auth/login/`
  6. await this.request.post(url, { username, password })
  7. }
  8. async logout(): Promise<void> {
  9. const url = '/auth/logout/'
  10. await this.request.post(url)
  11. }
  12. async socialLink(): Promise<any[]> {
  13. const url = '/social/links/'
  14. const response = await this.request.get(url)
  15. return response.data
  16. }
  17. }