mirror of
https://github.com/mollersuite/monofile.git
synced 2024-11-21 21:36:26 -08:00
rrrggrrr
This commit is contained in:
parent
dd39eff6b5
commit
982154465a
|
@ -55,7 +55,7 @@ fileApiRoutes.post("/manage", parser, (req,res) => {
|
|||
let acc = Accounts.getFromToken(req.cookies.auth) as Accounts.Account
|
||||
|
||||
if (!acc) return
|
||||
if (!req.body.target || req.body.target.length < 1) return
|
||||
if (!req.body.target || !(typeof req.body.target == "object") || req.body.target.length < 1) return
|
||||
|
||||
let modified = 0
|
||||
|
||||
|
|
|
@ -22,6 +22,26 @@ export let options = {
|
|||
id: "private"
|
||||
}
|
||||
],
|
||||
FV2: [
|
||||
{
|
||||
name: "Public",
|
||||
icon: "/static/assets/icons/public.svg",
|
||||
description: "Everyone can view this file",
|
||||
id: "public"
|
||||
},
|
||||
{
|
||||
name: "Anonymous",
|
||||
icon: "/static/assets/icons/anonymous.svg",
|
||||
description: "Your username will be hidden",
|
||||
id: "anonymous"
|
||||
},
|
||||
{
|
||||
name: "Private",
|
||||
icon: "/static/assets/icons/private.svg",
|
||||
description: "Nobody but you can view this file",
|
||||
id: "private"
|
||||
}
|
||||
],
|
||||
AYS: [
|
||||
{
|
||||
name: "Yes",
|
||||
|
@ -104,7 +124,7 @@ export function fileOptions(optPicker,file) {
|
|||
case "delete":
|
||||
|
||||
fetch(`/files/manage`,{method:"POST", body:JSON.stringify({
|
||||
target: [ file ],
|
||||
target: [ file.id ],
|
||||
action: "delete",
|
||||
})}).then((response) => {
|
||||
|
||||
|
@ -115,14 +135,16 @@ export function fileOptions(optPicker,file) {
|
|||
fetchFilePointers()
|
||||
})
|
||||
|
||||
break;
|
||||
|
||||
case "changeFileVisibility":
|
||||
|
||||
optPicker.picker("Set file visibility", options.FV).then((exp) => {
|
||||
optPicker.picker("Set file visibility", options.FV2).then((exp) => {
|
||||
|
||||
if (exp && exp.selected) {
|
||||
|
||||
fetch(`/files/manage`, {method: "POST", body: JSON.stringify({
|
||||
target: [ file ],
|
||||
target: [ file.id ],
|
||||
action: "changeFileVisibility",
|
||||
|
||||
value: exp.selected
|
||||
|
|
Loading…
Reference in a new issue