mirror of
https://github.com/utopia-os/utopia-ui.git
synced 2025-12-13 07:46:10 +00:00
29 lines
727 B
TypeScript
29 lines
727 B
TypeScript
/* eslint-disable no-console */
|
|
/* eslint-disable @typescript-eslint/no-unsafe-member-access */
|
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
import axios from 'axios'
|
|
|
|
import type { ItemsApi } from 'utopia-ui'
|
|
|
|
export class refiBcnApi implements ItemsApi<any> {
|
|
collectionName: string
|
|
|
|
constructor(collectionName: string) {
|
|
this.collectionName = collectionName
|
|
}
|
|
|
|
async getItems() {
|
|
try {
|
|
return (
|
|
await axios.get(
|
|
'https://antontranelis.github.io/ReFi-Barcelona-Prototype/projects/index.json',
|
|
)
|
|
).data.data
|
|
} catch (error: any) {
|
|
console.log(error)
|
|
if (error.errors[0]?.message) throw error.errors[0].message
|
|
else throw error
|
|
}
|
|
}
|
|
}
|