Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(NcTeamResources): Do not make extraneous requests for resources #6379

Merged
merged 1 commit into from
Jan 23, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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?.teamResourceProviders ?? []

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
Loading