Add expires_at field to object returned by subscribers API endpoint

This commit is contained in:
silverpill 2022-08-30 19:11:18 +00:00
parent 260e62d51b
commit 2ed8d44001
3 changed files with 8 additions and 0 deletions

View file

@ -1076,6 +1076,10 @@ components:
description: Sender address.
type: string
example: '0xd8da6bf...'
expires_at:
description: The date when subscription expires.
type: string
format: dateTime
Tag:
type: object
properties:

View file

@ -336,6 +336,7 @@ pub struct ApiSubscription {
pub id: i32,
pub sender: Account,
pub sender_address: String,
pub expires_at: DateTime<Utc>,
}
impl ApiSubscription {
@ -348,6 +349,7 @@ impl ApiSubscription {
id: subscription.id,
sender,
sender_address: subscription.sender_address,
expires_at: subscription.expires_at,
}
}
}

View file

@ -23,6 +23,7 @@ pub struct Subscription {
pub id: i32,
pub sender: DbActorProfile,
pub sender_address: String,
pub expires_at: DateTime<Utc>,
}
impl TryFrom<&Row> for Subscription {
@ -36,6 +37,7 @@ impl TryFrom<&Row> for Subscription {
id: db_subscription.id,
sender: db_sender,
sender_address: db_subscription.sender_address,
expires_at: db_subscription.expires_at,
})
}
}