feat: rebuild pet app and backend around core care flows
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
const { secure, toast } = require("../../utils/api");
|
||||
Page({
|
||||
data: { pets: [] },
|
||||
onShow() {
|
||||
this.load();
|
||||
},
|
||||
async load() {
|
||||
try {
|
||||
this.setData({ pets: await secure("/pets") });
|
||||
} catch (e) {
|
||||
toast(e);
|
||||
}
|
||||
},
|
||||
add() {
|
||||
wx.navigateTo({ url: "/pages/pet-edit/pet-edit" });
|
||||
},
|
||||
edit(e) {
|
||||
wx.navigateTo({
|
||||
url: "/pages/pet-edit/pet-edit?id=" + e.currentTarget.dataset.id,
|
||||
});
|
||||
},
|
||||
});
|
||||
Reference in New Issue
Block a user