Update background message name
This commit is contained in:
@@ -42,23 +42,22 @@ function Toy() {
|
||||
|
||||
const submitForm = (body: FormValue) => {
|
||||
sendToBackground({
|
||||
name: "bili",
|
||||
name: "toy",
|
||||
body: {
|
||||
action: "submitAddForm",
|
||||
action: "addToy",
|
||||
values: {
|
||||
...body,
|
||||
imageUrl: imgs[0],
|
||||
},
|
||||
},
|
||||
}).then((res) => {
|
||||
if (res.status === "Success") {
|
||||
add({
|
||||
content: res.msg,
|
||||
});
|
||||
}).catch((e) => {
|
||||
if (e instanceof Error) {
|
||||
add({
|
||||
content: "提交成功",
|
||||
});
|
||||
}
|
||||
else {
|
||||
add({
|
||||
content: res.msg,
|
||||
content: e.message,
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user