blob: 3e801b0885ebde793827af37056a6d4a18deb22a (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
|
use std::path::PathBuf;
use action_system::{action::ActionContext, macros::action_gen};
use serde::{Deserialize, Serialize};
use tcp_connection::error::TcpTargetError;
use crate::actions::{auth_member, check_connection_instance};
#[derive(Serialize, Deserialize)]
pub enum TrackFileActionResult {
Success,
// Fail
AuthorizeFailed(String),
}
#[action_gen]
pub async fn track_file_action(
ctx: ActionContext,
relative_pathes: Vec<PathBuf>,
) -> Result<TrackFileActionResult, TcpTargetError> {
let instance = check_connection_instance(&ctx)?;
// Auth Member
if let Err(e) = auth_member(&ctx, instance).await {
return Ok(TrackFileActionResult::AuthorizeFailed(e.to_string()));
};
if ctx.is_proc_on_local() {}
Err(TcpTargetError::NoResult("No result.".to_string()))
}
|