Skip to content

Commit 673c03a

Browse files
committed
feat: added member resolver for activities and new telegram bot advertiser
1 parent 5330e89 commit 673c03a

File tree

4 files changed

+32
-3
lines changed

4 files changed

+32
-3
lines changed

.github/workflows/registry-docker.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,3 +49,16 @@ jobs:
4949
push: true
5050
labels: ${{ steps.docker_meta.outputs.labels }}
5151
tags: ${{ steps.docker_meta.outputs.tags }}
52+
53+
- name: Telegram Notification
54+
uses: appleboy/telegram-action@master
55+
with:
56+
to: ${{ secrets.TELEGRAM_TO }}
57+
token: ${{ secrets.TELEGRAM_TOKEN }}
58+
message: |
59+
New image pushed to docker registry
60+
61+
Docker Tags: ${{ steps.docker_meta.outputs.tags }}
62+
Commit message: ${{ github.event.commits[0].message }}
63+
64+
See changes: https://github.com/${{ github.repository }}/commit/${{github.sha}}

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
edition = '2021'
33
name = 'plexo'
4-
version = '0.2.25'
4+
version = '0.2.26'
55

66
[dependencies]
77
async-graphql = { version = "6.0.6", features = [

src/sdk/activity.rs

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,15 @@
1-
use async_graphql::{Enum, SimpleObject};
1+
use async_graphql::{dataloader::DataLoader, ComplexObject, Context, Enum, Result, SimpleObject};
22
use chrono::{DateTime, Utc};
33
use uuid::Uuid;
44

55
use std::str::FromStr;
66

7+
use super::loaders::MemberLoader;
8+
use super::member::Member;
9+
use crate::graphql::auth::extract_context;
10+
711
#[derive(SimpleObject, Clone, Debug)]
12+
#[graphql(complex)]
813
pub struct Activity {
914
pub id: Uuid,
1015
pub created_at: DateTime<Utc>,
@@ -17,6 +22,17 @@ pub struct Activity {
1722
pub resource_type: ActivityResourceType,
1823
}
1924

25+
#[ComplexObject]
26+
impl Activity {
27+
pub async fn member(&self, ctx: &Context<'_>) -> Result<Member> {
28+
let (_plexo_engine, _member_id) = extract_context(ctx)?;
29+
30+
let loader = ctx.data::<DataLoader<MemberLoader>>()?;
31+
32+
Ok(loader.load_one(self.member_id).await?.unwrap())
33+
}
34+
}
35+
2036
#[derive(Enum, Copy, Clone, Eq, PartialEq, Debug)]
2137
pub enum ActivityOperationType {
2238
Create,

0 commit comments

Comments
 (0)