2024-12-04 14:24:53 +05:30
|
|
|
import { API_BASE_URL } from "@plane/constants";
|
|
|
|
|
// services
|
2024-07-22 16:01:46 +05:30
|
|
|
import { APIService } from "@/services/api.service";
|
2024-12-04 14:24:53 +05:30
|
|
|
// types
|
2024-07-22 16:01:46 +05:30
|
|
|
import { TPublicModule } from "@/types/modules";
|
|
|
|
|
|
|
|
|
|
export class ModuleService extends APIService {
|
|
|
|
|
constructor() {
|
|
|
|
|
super(API_BASE_URL);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
async getModules(anchor: string): Promise<TPublicModule[]> {
|
2024-08-01 14:12:57 +05:30
|
|
|
return this.get(`/api/public/anchor/${anchor}/modules/`)
|
2024-07-22 16:01:46 +05:30
|
|
|
.then((response) => response?.data)
|
|
|
|
|
.catch((error) => {
|
|
|
|
|
throw error?.response?.data;
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}
|