mirror of
https://github.com/pocket-id/pocket-id.git
synced 2025-12-10 07:02:57 +03:00
fix: session duration can't be updated
This commit is contained in:
@@ -16,5 +16,6 @@ type AppConfig 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) {
|
||||
savedConfigVariables := make([]model.AppConfigVariable, 10)
|
||||
var savedConfigVariables []model.AppConfigVariable
|
||||
|
||||
tx := s.db.Begin()
|
||||
rt := reflect.ValueOf(input).Type()
|
||||
@@ -78,7 +78,7 @@ func (s *AppConfigService) UpdateApplicationConfiguration(input model.AppConfigU
|
||||
return nil, err
|
||||
}
|
||||
|
||||
savedConfigVariables[i] = applicationConfigurationVariable
|
||||
savedConfigVariables = append(savedConfigVariables, applicationConfigurationVariable)
|
||||
}
|
||||
|
||||
tx.Commit()
|
||||
|
||||
@@ -10,10 +10,14 @@ test('Update general configuration', async ({ page }) => {
|
||||
await page.getByLabel('Session Duration').fill('30');
|
||||
await page.getByRole('button', { name: 'Save' }).first().click();
|
||||
|
||||
await expect(page.getByTestId('application-name')).toHaveText('Updated Name');
|
||||
await expect(page.getByRole('status')).toHaveText(
|
||||
'Application configuration updated successfully'
|
||||
);
|
||||
|
||||
await page.reload();
|
||||
|
||||
await expect(page.getByTestId('application-name')).toHaveText('Updated Name');
|
||||
await expect(page.getByTestId('session-duration')).toHaveText('30');
|
||||
});
|
||||
|
||||
test('Update application images', async ({ page }) => {
|
||||
|
||||
Reference in New Issue
Block a user