/* eslint-disable no-console */
import axios from "axios";
import Tag from "@models/Tag";

export const URL = `${process.env.NEXT_PUBLIC_API_URL}/tags/`;

// eslint-disable-next-line @typescript-eslint/no-empty-interface
export interface Options {
  // limit?: number;
  // offset?: number;
  // auth?: boolean;
}

class TagApi {
  static async getTags(): Promise<Tag[]> {
    try {
      const resp = await axios.get(URL);
      return resp.data.results;
    } catch (err) {
      console.error(err);
      throw err;
    }
  }
}

export default TagApi;
