Fixed 267U.pre3
This commit is contained in:
@@ -0,0 +1,41 @@
|
||||
import { DriveFiles } from "../../../../../models/index.js";
|
||||
import define from "../../../define.js";
|
||||
export const meta = {
|
||||
tags: [
|
||||
"drive"
|
||||
],
|
||||
requireCredential: true,
|
||||
kind: "read:drive",
|
||||
description: "Search for a drive file by a hash of the contents.",
|
||||
res: {
|
||||
type: "array",
|
||||
optional: false,
|
||||
nullable: false,
|
||||
items: {
|
||||
type: "object",
|
||||
optional: false,
|
||||
nullable: false,
|
||||
ref: "DriveFile"
|
||||
}
|
||||
}
|
||||
};
|
||||
export const paramDef = {
|
||||
type: "object",
|
||||
properties: {
|
||||
md5: {
|
||||
type: "string"
|
||||
}
|
||||
},
|
||||
required: [
|
||||
"md5"
|
||||
]
|
||||
};
|
||||
export default define(meta, paramDef, async (ps, user)=>{
|
||||
const files = await DriveFiles.findBy({
|
||||
md5: ps.md5,
|
||||
userId: user.id
|
||||
});
|
||||
return await DriveFiles.packMany(files, {
|
||||
self: true
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user