feat: rename js files to ts
This commit is contained in:

committed by
kolaente

parent
4cff3ebee1
commit
15b67136fe
29
src/services/backgroundUnsplash.ts
Normal file
29
src/services/backgroundUnsplash.ts
Normal file
@ -0,0 +1,29 @@
|
||||
import AbstractService from './abstractService'
|
||||
import BackgroundImageModel from '../models/backgroundImage'
|
||||
import ListModel from '../models/list'
|
||||
|
||||
export default class BackgroundUnsplashService extends AbstractService {
|
||||
constructor() {
|
||||
super({
|
||||
getAll: '/backgrounds/unsplash/search',
|
||||
update: '/lists/{listId}/backgrounds/unsplash',
|
||||
})
|
||||
}
|
||||
|
||||
modelFactory(data) {
|
||||
return new BackgroundImageModel(data)
|
||||
}
|
||||
|
||||
modelUpdateFactory(data) {
|
||||
return new ListModel(data)
|
||||
}
|
||||
|
||||
async thumb(model) {
|
||||
const response = await this.http({
|
||||
url: `/backgrounds/unsplash/images/${model.id}/thumb`,
|
||||
method: 'GET',
|
||||
responseType: 'blob',
|
||||
})
|
||||
return window.URL.createObjectURL(new Blob([response.data]))
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user