adding several features
This commit is contained in:
@@ -52,15 +52,32 @@ pub struct FolderDto {
|
||||
|
||||
impl From<Folder> for FolderDto {
|
||||
fn from(folder: Folder) -> Self {
|
||||
let is_root = folder.parent_id.is_none();
|
||||
let is_root = folder.parent_id().is_none();
|
||||
|
||||
Self {
|
||||
id: folder.id,
|
||||
name: folder.name,
|
||||
path: folder.path.to_string_lossy().to_string(),
|
||||
parent_id: folder.parent_id,
|
||||
created_at: folder.created_at,
|
||||
modified_at: folder.modified_at,
|
||||
id: folder.id().to_string(),
|
||||
name: folder.name().to_string(),
|
||||
path: folder.path_string().to_string(),
|
||||
parent_id: folder.parent_id().map(String::from),
|
||||
created_at: folder.created_at(),
|
||||
modified_at: folder.modified_at(),
|
||||
is_root,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Para convertir de FolderDto a Folder para los batch handlers
|
||||
impl From<FolderDto> for Folder {
|
||||
fn from(dto: FolderDto) -> Self {
|
||||
// Usar constructor para crear una entidad desde DTO
|
||||
// Nota: esto debe simplificarse si Folder tiene un constructor adecuado
|
||||
Folder::from_dto(
|
||||
dto.id,
|
||||
dto.name,
|
||||
dto.path,
|
||||
dto.parent_id,
|
||||
dto.created_at,
|
||||
dto.modified_at
|
||||
)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user