-
Notifications
You must be signed in to change notification settings - Fork 102
fix(backend): fix OP resource tests #2969
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
226f0aa
33822e8
6ec865d
307ae1a
c393604
e6b0f4a
41a6fac
832a756
125802f
fefe155
f14a4c2
d84c33f
55efcea
61fed7e
2650729
fc55dbe
8c5667a
22cf590
3e84958
ae491f0
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -20,10 +20,6 @@ exports.up = function (knex) { | |
| table.uuid('tenantId').notNullable() | ||
| table.foreign('tenantId').references('id').inTable('tenants') | ||
| }) | ||
| .table('grants', function (table) { | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Grant's don't need |
||
| table.uuid('tenantId').notNullable() | ||
| table.foreign('tenantId').references('id').inTable('tenants') | ||
| }) | ||
| } | ||
|
|
||
| /** | ||
|
|
@@ -48,8 +44,4 @@ exports.down = function (knex) { | |
| table.dropForeign(['tenantId']) | ||
| table.dropColumn('tenantId') | ||
| }) | ||
| .table('grants', function (table) { | ||
| table.dropForeign(['tenantId']) | ||
| table.dropColumn('tenantId') | ||
| }) | ||
| } | ||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,10 +1,5 @@ | ||
| import { ApolloContext } from '../../app' | ||
| import { Pagination, SortOrder } from '../../shared/baseModel' | ||
| import { getPageInfo } from '../../shared/pagination' | ||
| import { EndpointType, TenantEndpoint } from '../../tenant/endpoints/model' | ||
| import { | ||
| ResolversTypes, | ||
| TenantResolvers, | ||
| TenantEndpoint as SchemaTenantEndpoint, | ||
| TenantEndpointType | ||
| } from '../generated/graphql' | ||
|
|
@@ -14,45 +9,6 @@ export const mapTenantEndpointTypeToModelEndpointType = { | |
| [EndpointType.WebhookBaseUrl]: TenantEndpointType.WebhookBaseUrl | ||
| } | ||
|
|
||
| export const getTenantEndpoints: TenantResolvers<ApolloContext>['endpoints'] = | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Resolver not being used anymore
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. looks like it leaves the service |
||
| async ( | ||
| parent, | ||
| args, | ||
| ctx | ||
| ): Promise<ResolversTypes['TenantEndpointsConnection']> => { | ||
| if (!parent.id) { | ||
| throw new Error('missing tenant id') | ||
| } | ||
| const tenantEndpointService = await ctx.container.use( | ||
| 'tenantEndpointService' | ||
| ) | ||
|
|
||
| const { sortOrder, ...pagination } = args | ||
| const order = sortOrder === 'ASC' ? SortOrder.Asc : SortOrder.Desc | ||
|
|
||
| const tenantEndpoints = await tenantEndpointService.getPage( | ||
| parent.id, | ||
| pagination, | ||
| order | ||
| ) | ||
|
|
||
| console.log('TENANT ENDPOINTS: ', tenantEndpoints) | ||
|
|
||
| const pageInfo = await getPageInfo({ | ||
| getPage: (pagination_?: Pagination, sortOrder_?: SortOrder) => | ||
| tenantEndpointService.getPage(parent.id!, pagination_, sortOrder_), | ||
| page: tenantEndpoints | ||
| }) | ||
|
|
||
| return { | ||
| pageInfo, | ||
| edges: tenantEndpoints.map((endpoint: TenantEndpoint) => ({ | ||
| cursor: `${endpoint.tenantId}${endpoint.type}`, | ||
| node: tenantEndpointToGraphql(endpoint) | ||
| })) | ||
| } | ||
| } | ||
|
|
||
| export function tenantEndpointToGraphql( | ||
| tenantEndpoint: TenantEndpoint | ||
| ): SchemaTenantEndpoint { | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1071,8 +1071,6 @@ input CreateQuoteInput { | |
| receiver: String! | ||
| "Unique key to ensure duplicate or retried requests are processed only once. See [idempotence](https://en.wikipedia.org/wiki/Idempotence)" | ||
| idempotencyKey: String | ||
| "ID of the tenant" | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
I think perhaps this is the better pattern. It's simpler and I don't think we need to verify against the requestor's expectation for what the I remember you mentioning that before and not having much of an opinion but I came across it myself when dealing with checking access for the createQuote resolver and felt like passing it in wasn't really providing any value, and it does make the gql input less complicated. Since before it was required for everyone but really only needed when an operator is making it on behalf of a tenant. |
||
| tenantId: ID! | ||
| } | ||
|
|
||
| type QuoteResponse { | ||
|
|
@@ -1110,6 +1108,8 @@ input CreateOutgoingPaymentFromIncomingPaymentInput { | |
| metadata: JSONObject | ||
| "Unique key to ensure duplicate or retried requests are processed only once. See [idempotence](https://en.wikipedia.org/wiki/Idempotence)" | ||
| idempotencyKey: String | ||
| "ID of a tenant" | ||
| tenantId: ID! | ||
| } | ||
|
|
||
| input CreateIncomingPaymentInput { | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For some reason, probably due to rebasing, this got duplicated a few times.