-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
19 changed files
with
188 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
3 changes: 3 additions & 0 deletions
3
frontend/nos-crossposting-service-frontend/src/dto/PublicKey.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export class PublicKey { | ||
npub?: string; | ||
} |
5 changes: 5 additions & 0 deletions
5
frontend/nos-crossposting-service-frontend/src/dto/PublicKeys.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import {PublicKey} from "@/dto/PublicKey"; | ||
|
||
export class PublicKeys { | ||
publicKeys?: PublicKey[]; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
package app | ||
|
||
import ( | ||
"context" | ||
|
||
"github.com/boreq/errors" | ||
"github.com/planetary-social/nos-crossposting-service/internal/logging" | ||
"github.com/planetary-social/nos-crossposting-service/service/domain" | ||
"github.com/planetary-social/nos-crossposting-service/service/domain/accounts" | ||
) | ||
|
||
type GetAccountPublicKeys struct { | ||
accountID accounts.AccountID | ||
} | ||
|
||
func NewGetAccountPublicKeys(accountID accounts.AccountID) GetAccountPublicKeys { | ||
return GetAccountPublicKeys{accountID: accountID} | ||
} | ||
|
||
type GetAccountPublicKeysHandler struct { | ||
transactionProvider TransactionProvider | ||
logger logging.Logger | ||
metrics Metrics | ||
} | ||
|
||
func NewGetAccountPublicKeysHandler( | ||
transactionProvider TransactionProvider, | ||
logger logging.Logger, | ||
metrics Metrics, | ||
) *GetAccountPublicKeysHandler { | ||
return &GetAccountPublicKeysHandler{ | ||
transactionProvider: transactionProvider, | ||
logger: logger.New("getAccountPublicKeys"), | ||
metrics: metrics, | ||
} | ||
} | ||
|
||
func (h *GetAccountPublicKeysHandler) Handle(ctx context.Context, cmd GetAccountPublicKeys) (result []*domain.LinkedPublicKey, err error) { | ||
defer h.metrics.StartApplicationCall("getAccountPublicKeys").End(&err) | ||
|
||
if err := h.transactionProvider.Transact(ctx, func(ctx context.Context, adapters Adapters) error { | ||
publicKeys, err := adapters.PublicKeys.ListByAccountID(cmd.accountID) | ||
if err != nil { | ||
return errors.Wrap(err, "error getting a session") | ||
} | ||
|
||
result = publicKeys | ||
return nil | ||
}); err != nil { | ||
return nil, errors.Wrap(err, "transaction error") | ||
} | ||
|
||
return result, nil | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
<!doctype html><html lang=""><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1"><link rel="icon" href="/favicon.ico"><title>nos-crossposting-service-frontend</title><script defer="defer" src="/js/chunk-vendors.6ebd820c.js"></script><script defer="defer" src="/js/app.1a52fb73.js"></script><link href="/css/app.ddbde395.css" rel="stylesheet"></head><body><noscript><strong>We're sorry but nos-crossposting-service-frontend doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id="app"></div></body></html> | ||
<!doctype html><html lang=""><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1"><link rel="icon" href="/favicon.ico"><title>nos-crossposting-service-frontend</title><script defer="defer" src="/js/chunk-vendors.aa55fb88.js"></script><script defer="defer" src="/js/app.a0bb4349.js"></script><link href="/css/app.ddbde395.css" rel="stylesheet"></head><body><noscript><strong>We're sorry but nos-crossposting-service-frontend doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id="app"></div></body></html> |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.