import { Request } from 'root/app/request' ; import { asString } from 'root/lib/type_utils' ; export async function checkFileBeforeUpload ( checkmd5 ) { const res = await Request . gzip ( '/mtg/uploadcards.php?version=1' , { checkmd5 } ) ; const resMap = asString ( res ) ; return resMap === 'UPDATE' ; } export async function doFileUpload ( file , name ) { const res = await Request . gzip ( '/mtg/uploadcards.php?version=1' , { file , name } ) ; const resMap = asString ( res ) ; return resMap === 'UPDATE' ; }