fix type check

This commit is contained in:
Andreani Jean
2023-07-19 18:45:48 +02:00
parent ad60792020
commit 0e9ec753da
2 changed files with 10 additions and 6 deletions

View File

@@ -27,7 +27,7 @@ import {
let pictures = ref<any>()
function toto($event: Event) {
function toto($event: any) {
pictures.value = [...$event.target.files]
.filter((p) => p.type == 'image/jpeg')
.sort((a, b) => a.name.localeCompare(b.name))
@@ -43,7 +43,7 @@ async function tata() {
return await createAPictureToASequence(id, body)
}
try {
pictures.value.map(async (el, i) => {
pictures.value.map(async (el: any, i: any) => {
const body = new FormData()
body.append('position', i + 1)
body.append('picture', el)
@@ -55,10 +55,14 @@ async function tata() {
}
}
function addPictures($event: Event) {
function addPictures($event: any) {
pictures.value = $event.target.files
}
function uploadNextPicture(collectionId: string, pictures, currentPictureId) {
function uploadNextPicture(
collectionId: string,
pictures: any,
currentPictureId: any
): any {
const picFile = pictures[currentPictureId]
const pos = currentPictureId + 1

View File

@@ -1,10 +1,10 @@
import axios from 'axios'
function createASequence(title: string): Promise<unknown> {
function createASequence(title: string): Promise<any> {
return axios.post('api/collections', { title: title })
}
function createAPictureToASequence(id: string, body: any): Promise<unknown> {
function createAPictureToASequence(id: string, body: any): Promise<any> {
console.log(id, body)
return axios.post(`api/collections/${id}/items`, body)
}