Skip to content

Commit

Permalink
fix(NcTeamResources): Do not make extraneous requests for resources
Browse files Browse the repository at this point in the history
Signed-off-by: Christopher Ng <[email protected]>
  • Loading branch information
Pytal committed Jan 13, 2025
1 parent bacf670 commit bd1b236
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/components/NcRelatedResourcesPanel/NcTeamResources.vue
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@
<script>
import axios from '@nextcloud/axios'
import { generateOcsUrl } from '@nextcloud/router'
import { getCapabilities } from '@nextcloud/capabilities'
import AccountGroup from 'vue-material-design-icons/AccountGroup.vue'
import ChevronDown from 'vue-material-design-icons/ChevronDown.vue'
import ChevronUp from 'vue-material-design-icons/ChevronUp.vue'
Expand All @@ -77,6 +78,8 @@ import NcIconSvgWrapper from '../NcIconSvgWrapper/NcIconSvgWrapper.vue'

import { t } from '../../l10n.js'

const teamResourceProviders = getCapabilities()?.circles?.teamResourcesProviders ?? []

export default {
name: 'NcTeamResources',

Expand Down Expand Up @@ -158,6 +161,9 @@ export default {
methods: {
t,
async fetchTeamResources() {
if (!teamResourceProviders.includes(this.providerId)) {
return
}
try {
this.loading = true
const response = await axios.get(generateOcsUrl(`/teams/resources/${this.providerId}/${this.itemId}`))
Expand Down

0 comments on commit bd1b236

Please sign in to comment.