feat: add subscribe
This commit is contained in:
@@ -61,7 +61,12 @@ add.run = async (ctx) => {
|
||||
containerModel = await ContainerModel.findByPk(container.id);
|
||||
if (containerModel) {
|
||||
containerModel.update(container);
|
||||
containerModel.save();
|
||||
await containerModel.save();
|
||||
ctx.emit?.('pageEdit', {
|
||||
source: 'container',
|
||||
data: containerModel.toJSON(),
|
||||
operation: 'edit',
|
||||
});
|
||||
}
|
||||
} else {
|
||||
try {
|
||||
@@ -94,13 +99,12 @@ deleteRoute.run = async (ctx) => {
|
||||
};
|
||||
deleteRoute.addTo(app);
|
||||
|
||||
const publish = app.route({
|
||||
path: 'container',
|
||||
key: 'publish',
|
||||
});
|
||||
publish.nextRoute = { path: 'resource', key: 'publishContainer' };
|
||||
|
||||
publish
|
||||
app
|
||||
.route({
|
||||
path: 'container',
|
||||
key: 'publish',
|
||||
nextRoute: { path: 'resource', key: 'publishContainer' },
|
||||
})
|
||||
.define(async (ctx) => {
|
||||
const { data } = ctx.query;
|
||||
const { id, publish, type = 'patch', beta = false } = data;
|
||||
|
||||
Reference in New Issue
Block a user