feat: add byid
This commit is contained in:
		@@ -14,7 +14,6 @@ getRouterList.run = async (ctx) => {
 | 
				
			|||||||
router.add(getRouterList);
 | 
					router.add(getRouterList);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// remove router
 | 
					// remove router
 | 
				
			||||||
 | 
					 | 
				
			||||||
export const removeRouter = new Route('admin', 'removeRouter');
 | 
					export const removeRouter = new Route('admin', 'removeRouter');
 | 
				
			||||||
removeRouter.run = async (ctx) => {
 | 
					removeRouter.run = async (ctx) => {
 | 
				
			||||||
  const { path, key } = ctx.query;
 | 
					  const { path, key } = ctx.query;
 | 
				
			||||||
@@ -24,6 +23,16 @@ removeRouter.run = async (ctx) => {
 | 
				
			|||||||
}
 | 
					}
 | 
				
			||||||
router.add(removeRouter);
 | 
					router.add(removeRouter);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					// remove router by id
 | 
				
			||||||
 | 
					export const removeRouterById = new Route('admin', 'removeRouterById');
 | 
				
			||||||
 | 
					removeRouterById.run = async (ctx) => {
 | 
				
			||||||
 | 
					  const { id } = ctx.query;
 | 
				
			||||||
 | 
					  router.removeById(id);
 | 
				
			||||||
 | 
					  ctx.body = 'success';
 | 
				
			||||||
 | 
					  return ctx;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					router.add(removeRouterById);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// add router
 | 
					// add router
 | 
				
			||||||
export const addRouter = new Route('admin', 'addRouter');
 | 
					export const addRouter = new Route('admin', 'addRouter');
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user