mirror of
https://github.com/pocket-id/pocket-id.git
synced 2026-03-29 18:56:36 +00:00
Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d92b80b80f | ||
|
|
aaed71e1c8 | ||
|
|
4780548843 |
@@ -1,3 +1,10 @@
|
|||||||
|
## [](https://github.com/stonith404/pocket-id/compare/v0.2.0...v) (2024-08-19)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* session duration can't be updated ([4780548](https://github.com/stonith404/pocket-id/commit/478054884389ed8a08d707fd82da7b31177a67e5))
|
||||||
|
|
||||||
## [](https://github.com/stonith404/pocket-id/compare/v0.1.3...v) (2024-08-19)
|
## [](https://github.com/stonith404/pocket-id/compare/v0.1.3...v) (2024-08-19)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -17,4 +17,5 @@ type AppConfig struct {
|
|||||||
|
|
||||||
type AppConfigUpdateDto struct {
|
type AppConfigUpdateDto struct {
|
||||||
AppName string `json:"appName" binding:"required"`
|
AppName string `json:"appName" binding:"required"`
|
||||||
|
SessionDuration string `json:"sessionDuration" binding:"required"`
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -55,7 +55,7 @@ var defaultDbConfig = model.AppConfig{
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (s *AppConfigService) UpdateApplicationConfiguration(input model.AppConfigUpdateDto) ([]model.AppConfigVariable, error) {
|
func (s *AppConfigService) UpdateApplicationConfiguration(input model.AppConfigUpdateDto) ([]model.AppConfigVariable, error) {
|
||||||
savedConfigVariables := make([]model.AppConfigVariable, 10)
|
var savedConfigVariables []model.AppConfigVariable
|
||||||
|
|
||||||
tx := s.db.Begin()
|
tx := s.db.Begin()
|
||||||
rt := reflect.ValueOf(input).Type()
|
rt := reflect.ValueOf(input).Type()
|
||||||
@@ -78,7 +78,7 @@ func (s *AppConfigService) UpdateApplicationConfiguration(input model.AppConfigU
|
|||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
savedConfigVariables[i] = applicationConfigurationVariable
|
savedConfigVariables = append(savedConfigVariables, applicationConfigurationVariable)
|
||||||
}
|
}
|
||||||
|
|
||||||
tx.Commit()
|
tx.Commit()
|
||||||
|
|||||||
@@ -10,10 +10,15 @@ test('Update general configuration', async ({ page }) => {
|
|||||||
await page.getByLabel('Session Duration').fill('30');
|
await page.getByLabel('Session Duration').fill('30');
|
||||||
await page.getByRole('button', { name: 'Save' }).first().click();
|
await page.getByRole('button', { name: 'Save' }).first().click();
|
||||||
|
|
||||||
await expect(page.getByTestId('application-name')).toHaveText('Updated Name');
|
|
||||||
await expect(page.getByRole('status')).toHaveText(
|
await expect(page.getByRole('status')).toHaveText(
|
||||||
'Application configuration updated successfully'
|
'Application configuration updated successfully'
|
||||||
);
|
);
|
||||||
|
await expect(page.getByTestId('application-name')).toHaveText('Updated Name');
|
||||||
|
|
||||||
|
await page.reload();
|
||||||
|
|
||||||
|
await expect(page.getByLabel('Name')).toHaveValue('Updated Name');
|
||||||
|
await expect(page.getByLabel('Session Duration')).toHaveValue('30');
|
||||||
});
|
});
|
||||||
|
|
||||||
test('Update application images', async ({ page }) => {
|
test('Update application images', async ({ page }) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user