-
-
Notifications
You must be signed in to change notification settings - Fork 440
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
feat(core): add account center api #6772
base: master
Are you sure you want to change the base?
feat(core): add account center api #6772
Conversation
COMPARE TO
|
Name | Diff |
---|---|
packages/core/src/queries/account-center.ts | 📈 +1.81 KB |
packages/core/src/routes/account-center/index.openapi.json | 📈 +1.2 KB |
packages/core/src/routes/account-center/index.ts | 📈 +1.28 KB |
packages/core/src/routes/init.ts | 📈 +162 Bytes |
packages/core/src/routes/swagger/utils/documents.ts | 📈 +76 Bytes |
packages/core/src/tenants/Queries.ts | 📈 +125 Bytes |
packages/integration-tests/src/api/account-center.ts | 📈 +487 Bytes |
packages/integration-tests/src/tests/api/account-center.test.ts | 📈 +776 Bytes |
packages/schemas/src/foundations/jsonb-types/account-center.ts | 📈 +969 Bytes |
4cd7e01
to
007de0a
Compare
864ffa8
to
cf5f426
Compare
cf5f426
to
d8457c8
Compare
d8457c8
to
daa82e0
Compare
public readonly insert = buildInsertIntoWithPool(this.pool)(AccountCenters, { | ||
returning: true, | ||
}); | ||
|
||
public readonly update = buildUpdateWhereWithPool(this.pool)(AccountCenters, true); | ||
|
||
public readonly find = buildFindEntityByIdWithPool(this.pool)(AccountCenters); |
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.
How about extending the SchemaQueries
class? No need to redefine these standard query methods.
const defaultAccountCenter: Omit<AccountCenter, 'tenantId'> = { | ||
id: 'default', | ||
enabled: false, | ||
fields: {}, | ||
}; |
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.
Should we put this default value definition under @logto/schemas
?
Actually should we seed the default value in DB with a DB alteration?
return accountCenter; | ||
} | ||
|
||
await this.insert(defaultAccountCenter); |
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.
return await this.insert(defaultAccountCenter)
will return the inserted value?
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.
As commented above, can we follow the default SIE pattern, seed the default values in DB directly? Looks to me this fallback logic is for one-time use only, should not be placed in this query method.
Summary
Add GET/PATCH api of account center, this settings will be used the control the global access of Profile API.
Testing
Integration tests.
Checklist
.changeset