delLogic.js
709 Bytes
import {_delList,_delTask} from "../service/AppService";
import {Alert} from 'react-native';
import Toast from "react-native-simple-toast";
export const delList=async(id)=>{
try{
const data=await _delList({id})
const {errors, firstErrorMessage}=data
if (errors.length > 0) {
Toast.show(firstErrorMessage)
return false
} else {
Toast.show("删除成功")
return true
}
}catch(e){
console.log(e)
}
}
export const delTask=async(id)=>{
try{
const data=await _delTask({id})
const {errors, firstErrorMessage}=data
if (errors.length > 0) {
Toast.show(firstErrorMessage)
return false
} else {
Toast.show("删除成功")
return true
}
}catch(e){
console.log(e)
}
}