From 1fa556cd00daa34ff7fcd2f33d81d70178b6156c Mon Sep 17 00:00:00 2001 From: Geometrically <18202329+Geometrically@users.noreply.github.com> Date: Sun, 7 Jan 2024 00:17:22 -0500 Subject: [PATCH] Fix moderation + oauth (#1515) --- pages/[type]/[id]/settings/links.vue | 5 ---- pages/moderation/review.vue | 24 +++++++++++++++---- .../organization/[id]/settings/analytics.vue | 2 +- pages/settings/applications.vue | 8 +++---- 4 files changed, 25 insertions(+), 14 deletions(-) diff --git a/pages/[type]/[id]/settings/links.vue b/pages/[type]/[id]/settings/links.vue index a3dff5133..24184767c 100644 --- a/pages/[type]/[id]/settings/links.vue +++ b/pages/[type]/[id]/settings/links.vue @@ -199,11 +199,6 @@ export default defineNuxtComponent({ } const donationLinks = this.donationLinks.filter((link) => link.url && link.platform) - donationLinks.forEach((link) => { - link.id = this.tags.donationPlatforms.find( - (platform) => platform.name === link.platform - ).short - }) if ( donationLinks !== this.project.donation_urls && !( diff --git a/pages/moderation/review.vue b/pages/moderation/review.vue index 974a85369..580247197 100644 --- a/pages/moderation/review.vue +++ b/pages/moderation/review.vue @@ -53,9 +53,21 @@
by - - - {{ project.owner.username }} + + + {{ project.owner.user.username }} + + + + {{ project.org.name }}
@@ -144,9 +156,12 @@ const projectTypes = computed(() => { if (projects.value) { const teamIds = projects.value.map((x) => x.team) + const organizationIds = projects.value.filter((x) => x.organization).map((x) => x.organization) const url = `teams?ids=${encodeURIComponent(JSON.stringify(teamIds))}` + const orgUrl = `organizations?ids=${encodeURIComponent(JSON.stringify(organizationIds))}` const { data: result } = await useAsyncData(url, () => useBaseFetch(url)) + const { data: orgs } = await useAsyncData(orgUrl, () => useBaseFetch(orgUrl, { apiVersion: 3 })) if (result.value) { members.value = result.value @@ -154,7 +169,8 @@ if (projects.value) { projects.value = projects.value.map((project) => { project.owner = members.value .flat() - .find((x) => x.team_id === project.team && x.role === 'Owner').user + .find((x) => x.team_id === project.team && x.role === 'Owner') + project.org = orgs.value.find((x) => x.id === project.organization) project.age = project.queued ? now - app.$dayjs(project.queued) : Number.MAX_VALUE project.age_warning = '' if (project.age > TIME_24H * 2) { diff --git a/pages/organization/[id]/settings/analytics.vue b/pages/organization/[id]/settings/analytics.vue index 74cc938d4..5db39b14d 100644 --- a/pages/organization/[id]/settings/analytics.vue +++ b/pages/organization/[id]/settings/analytics.vue @@ -10,7 +10,7 @@

- + diff --git a/pages/settings/applications.vue b/pages/settings/applications.vue index bf7a190fa..48333034b 100644 --- a/pages/settings/applications.vue +++ b/pages/settings/applications.vue @@ -323,7 +323,7 @@ async function onImageSelection(files) { await useBaseFetch('oauth/app/' + editingId.value + '/icon', { method: 'PATCH', - apiVersion: 3, + internal: true, body: file, query: { ext: extFromType, @@ -352,7 +352,7 @@ async function createApp() { try { const createdAppInfo = await useBaseFetch('oauth/app', { method: 'POST', - apiVersion: 3, + internal: true, body: { name: name.value, icon_url: icon.value, @@ -427,7 +427,7 @@ async function editApp() { await useBaseFetch('oauth/app/' + editingId.value, { method: 'PATCH', - apiVersion: 3, + internal: true, body, }) @@ -455,7 +455,7 @@ async function removeApp() { throw new Error('No editing id') } await useBaseFetch(`oauth/app/${editingId.value}`, { - apiVersion: 3, + internal: true, method: 'DELETE', }) await refresh()