-
Notifications
You must be signed in to change notification settings - Fork 103
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(xero): Fix syncing xero accounts (#2290)
## Roadmap Task 👉 https://getlago.canny.io/feature-requests/p/integration-with-xero ## Context Currently Lago does not support accounting integrations ## Description This PR removes the accounts resolver and adds FetchAccounts mutation instead.
- Loading branch information
1 parent
2d839f5
commit f3d17bf
Showing
13 changed files
with
246 additions
and
263 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# frozen_string_literal: true | ||
|
||
module Mutations | ||
module IntegrationItems | ||
class FetchAccounts < BaseMutation | ||
include AuthenticableApiUser | ||
include RequiredOrganization | ||
|
||
REQUIRED_PERMISSION = 'organization:integrations:update' | ||
|
||
graphql_name 'FetchIntegrationAccounts' | ||
description 'Fetch integration accounts' | ||
|
||
argument :integration_id, ID, required: true | ||
|
||
type Types::IntegrationItems::Object.collection_type, null: false | ||
|
||
def resolve(**args) | ||
integration = current_organization.integrations.find_by(id: args[:integration_id]) | ||
|
||
::Integrations::Aggregator::SyncService.call(integration:, options: {only_accounts: true}) | ||
|
||
result = ::Integrations::Aggregator::AccountsService.call(integration:) | ||
|
||
result.success? ? result.accounts : result_error(result) | ||
end | ||
end | ||
end | ||
end |
This file was deleted.
Oops, something went wrong.
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.