

async function createTutor() {
    let response = await fetch("http://dev.fmode.cn:1337/parse/classes/Tutor", {
        "headers": {
            "content-type": "text/plain;charset=UTF-8",
            "x-parse-application-id": "dev"
        },
        "body": JSON.stringify({
            name: "王教练",
            age: 32
        }),
        "method": "POST",
        "mode": "cors",
        "credentials": "omit"
    });
    let data = await response.json()
    console.log(data)
}

// createTutor()



async function updateTutor(objectId, updateData) {
    let response = await fetch("http://dev.fmode.cn:1337/parse/classes/Tutor/" + objectId, {
        "headers": {
            "content-type": "text/plain;charset=UTF-8",
            "x-parse-application-id": "dev"
        },
        "body": JSON.stringify(updateData),
        "method": "PUT",
        "mode": "cors",
        "credentials": "omit"
    });
    let data = await response.json()
    console.log(data)
}

// updateTutor("DlvWtHrQRt", { price: 200 })

async function deleteTutor(objectId) {
    let response = await fetch("http://dev.fmode.cn:1337/parse/classes/Tutor/" + objectId, {
        "headers": {
            "content-type": "text/plain;charset=UTF-8",
            "x-parse-application-id": "dev"
        },
        "body": null,
        "method": "DELETE",
        "mode": "cors",
        "credentials": "omit"
    });
    let data = await response.json()
    console.log(data)
}
deleteTutor("DlvWtHrQRt")
