Skip to content

Commit

Permalink
fix: retrieve saved data
Browse files Browse the repository at this point in the history
Signed-off-by: Vitor Mattos <[email protected]>

[skip ci]
  • Loading branch information
vitormattos authored and backportbot-libresign[bot] committed Jan 28, 2025
1 parent adcd212 commit 7cf878b
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 16 deletions.
24 changes: 11 additions & 13 deletions src/views/Settings/AllowedGroups.vue
Original file line number Diff line number Diff line change
Expand Up @@ -90,20 +90,18 @@ export default {

async searchGroup(query) {
this.loadingGroups = true
try {
const response = await axios.get(generateOcsUrl('cloud/groups/details'), {
search: query,
limit: 20,
offset: 0,
})
this.groups = response.data.ocs.data.groups.sort(function(a, b) {
return a.displayname.localeCompare(b.displayname)
await axios.get(generateOcsUrl('cloud/groups/details'), {
search: query,
limit: 20,
offset: 0,
})
.then(({ data }) => {
this.groups = data.ocs.data.groups.sort(function(a, b) {
return a.displayname.localeCompare(b.displayname)
})
})
} catch (err) {
console.error('Could not fetch groups', err)
} finally {
this.loadingGroups = false
}
.catch((error) => logger.debug('Could not search by groups', { error }))
this.loadingGroups = false
},
},

Expand Down
2 changes: 1 addition & 1 deletion src/views/Settings/CollectMetadata.vue
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export default {
async getData() {
const responseCollectMetadata = await axios.get(generateOcsUrl('/apps/provisioning_api/api/v1/config/apps/libresign/collect_metadata'))
const value = responseCollectMetadata?.data?.ocs?.data?.data
this.collectMetadataEnabled = value === true || value === 'true'
this.collectMetadataEnabled = ['true', true, '1', 1].includes(value)
},
saveCollectMetadata() {
OCP.AppConfig.setValue('libresign', 'collect_metadata', this.collectMetadataEnabled ? 1 : 0)
Expand Down
6 changes: 4 additions & 2 deletions src/views/Settings/IdentificationDocuments.vue
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,10 @@ export default {
},
methods: {
async getData() {
const responseIdentificationDocuments = await axios.get(generateOcsUrl('/apps/provisioning_api/api/v1/config/apps/libresign/identification_documents'))
this.identificationDocumentsFlowEnabled = !!responseIdentificationDocuments.data.ocs.data.data
await axios.get(generateOcsUrl('/apps/provisioning_api/api/v1/config/apps/libresign/identification_documents'))
.then(({ data }) => {
this.identificationDocumentsFlowEnabled = ['true', true, '1', 1].includes(data.ocs.data.data)
})

await axios.get(
generateOcsUrl('/apps/provisioning_api/api/v1/config/apps/libresign/approval_group'),
Expand Down

0 comments on commit 7cf878b

Please sign in to comment.