server
server copied to clipboard
fix: do not extract fields for blank template
- Part of: https://github.com/nextcloud/richdocuments/issues/4811
Summary
There is a request to the /ocs/v2.php/apps/files/api/v1/templates/fields/{fileid} endpoint where the file ID is undefined. This was due to the template field extraction request being submitted on the blank template and invalid template selections as well. In this case, we skip the request and use an empty array of fields.
In the end, it saves a few miliseconds of time in these cases.
Checklist
- Code is properly formatted
- Sign-off message is added to all commits
- [ ] Tests (unit, integration, api and/or acceptance) are included
- [ ] Screenshots before/after for front-end changes
- [ ] Documentation (manuals or wiki) has been updated or is not required
- [ ] Backports requested where applicable (ex: critical bugfixes)