Merge pull request #770 from DragoSpiro98/master

Feat: Route reference for file manager to create a new empty file
This commit is contained in:
unitwk 2022-11-29 10:51:52 +08:00 committed by GitHub
commit 601d263be8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -77,6 +77,27 @@ router.get(
}
);
router.post(
"/touch",
permission({ level: 1 }),
validator({ query: { remote_uuid: String, uuid: String }, body: { target: String } }),
async (ctx) => {
try {
const serviceUuid = String(ctx.query.remote_uuid);
const instanceUuid = String(ctx.query.uuid);
const target = String(ctx.request.body.target);
const remoteService = RemoteServiceSubsystem.getInstance(serviceUuid);
const result = await new RemoteRequest(remoteService).request("file/touch", {
target,
instanceUuid
});
ctx.body = result;
} catch (err) {
ctx.body = err;
}
}
);
router.post(
"/mkdir",
permission({ level: 1 }),