Skip to content

Commit

Permalink
Fix component repo
Browse files Browse the repository at this point in the history
  • Loading branch information
vigoo committed Dec 5, 2024
1 parent 0f3c92d commit ff49c09
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions golem-component-service-base/src/repo/component.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ pub struct ComponentRecord<Owner: ComponentOwner> {
pub created_at: DateTime<Utc>,
pub component_type: i32,
pub available: bool,
pub object_store_key: String,
pub transformed_object_store_key: String,
pub object_store_key: Option<String>,
pub transformed_object_store_key: Option<String>,
// one-to-many relationship. Retrieved separately
#[sqlx(skip)]
pub files: Vec<FileRecord>,
Expand Down Expand Up @@ -84,10 +84,12 @@ impl<Owner: ComponentOwner> ComponentRecord<Owner> {
created_at: value.created_at,
component_type: value.component_type as i32,
available,
object_store_key: object_store_key.clone(),
transformed_object_store_key: value
.transformed_object_store_key
.unwrap_or(object_store_key),
object_store_key: Some(object_store_key.clone()),
transformed_object_store_key: Some(
value
.transformed_object_store_key
.unwrap_or(object_store_key),
),
files: value
.files
.iter()
Expand Down Expand Up @@ -141,8 +143,8 @@ impl<Owner: ComponentOwner> TryFrom<ComponentRecord<Owner>> for Component<Owner>
versioned_component_id,
created_at: value.created_at,
component_type: ComponentType::try_from(value.component_type)?,
object_store_key: Some(value.object_store_key),
transformed_object_store_key: Some(value.transformed_object_store_key),
object_store_key: value.object_store_key,
transformed_object_store_key: value.transformed_object_store_key,
files,
installed_plugins: value
.installed_plugins
Expand Down

0 comments on commit ff49c09

Please sign in to comment.