mirror of
https://github.com/Arcadia-Solutions/arcadia.git
synced 2025-12-16 23:14:15 -06:00
use openapi-generator (#421)
This commit is contained in:
@@ -107,6 +107,7 @@ use crate::handlers::{
|
||||
crate::handlers::css_sheets::edit_css_sheet::exec,
|
||||
crate::handlers::css_sheets::get_css_sheet_content::exec,
|
||||
crate::handlers::css_sheets::get_css_sheets::exec,
|
||||
crate::handlers::css_sheets::get_css_sheet::exec,
|
||||
crate::handlers::external_db::get_isbn_data::exec,
|
||||
crate::handlers::external_db::get_musicbrainz_data::exec,
|
||||
crate::handlers::external_db::get_tmdb_data::exec,
|
||||
@@ -122,7 +123,7 @@ use crate::handlers::{
|
||||
TorrentSearch,
|
||||
ForumSearchQuery,
|
||||
SearchTitleGroupTagsLiteQuery,
|
||||
SearchTitleGroupTagsQuery
|
||||
SearchTitleGroupTagsQuery,
|
||||
),)
|
||||
)]
|
||||
pub struct ApiDoc;
|
||||
|
||||
@@ -11,7 +11,7 @@ use arcadia_storage::{
|
||||
|
||||
#[utoipa::path(
|
||||
post,
|
||||
operation_id = "Create artist",
|
||||
operation_id = "Create artists",
|
||||
tag = "Artist",
|
||||
path = "/api/artists",
|
||||
security(
|
||||
|
||||
@@ -11,7 +11,7 @@ use arcadia_storage::{
|
||||
|
||||
#[utoipa::path(
|
||||
post,
|
||||
operation_id = "Create a collage",
|
||||
operation_id = "Create collage",
|
||||
tag = "Collages",
|
||||
path = "/api/collages",
|
||||
security(
|
||||
|
||||
@@ -15,9 +15,10 @@ pub struct GetCollageQuery {
|
||||
|
||||
#[utoipa::path(
|
||||
get,
|
||||
operation_id = "Get a collage",
|
||||
operation_id = "Get collage",
|
||||
tag = "Collages",
|
||||
path = "/api/collages",
|
||||
params(GetCollageQuery),
|
||||
security(
|
||||
("http" = ["Bearer"])
|
||||
),
|
||||
|
||||
@@ -15,7 +15,7 @@ pub struct GetConversationQuery {
|
||||
|
||||
#[utoipa::path(
|
||||
get,
|
||||
operation_id = "Get conversations",
|
||||
operation_id = "Get conversation",
|
||||
tag = "Conversation",
|
||||
params(GetConversationQuery),
|
||||
path = "/api/conversations",
|
||||
|
||||
@@ -9,7 +9,7 @@ use serde_json::json;
|
||||
|
||||
#[utoipa::path(
|
||||
get,
|
||||
operation_id = "Create forum",
|
||||
operation_id = "Get forum",
|
||||
tag = "Forum",
|
||||
path = "/api/forum",
|
||||
responses(
|
||||
|
||||
@@ -15,7 +15,7 @@ pub struct GetForumSubCategoryThreadsQuery {
|
||||
|
||||
#[utoipa::path(
|
||||
get,
|
||||
operation_id = "Get forim sub-category thread",
|
||||
operation_id = "Get forum sub-category threads",
|
||||
tag = "Forum",
|
||||
path = "/api/forum/sub-category",
|
||||
params(GetForumSubCategoryThreadsQuery),
|
||||
|
||||
@@ -14,7 +14,7 @@ use arcadia_storage::{
|
||||
|
||||
#[utoipa::path(
|
||||
post,
|
||||
operation_id = "Reply to staff PM",
|
||||
operation_id = "Create staff PM message",
|
||||
tag = "StaffPM",
|
||||
path = "/api/staff-pms/messages",
|
||||
security(("http" = ["Bearer"])) ,
|
||||
|
||||
@@ -17,7 +17,7 @@ pub struct GetTorrentRequestQuery {
|
||||
|
||||
#[utoipa::path(
|
||||
get,
|
||||
operation_id = "Get torrent requests",
|
||||
operation_id = "Get torrent request",
|
||||
tag = "Torrent Request",
|
||||
path = "/api/torrent-requests",
|
||||
params(GetTorrentRequestQuery),
|
||||
|
||||
@@ -19,7 +19,7 @@ pub struct DownloadTorrentQuery {
|
||||
|
||||
#[utoipa::path(
|
||||
get,
|
||||
operation_id = "Download .torrent file",
|
||||
operation_id = "Download torrent file",
|
||||
tag = "Torrent",
|
||||
path = "/api/torrents",
|
||||
params (DownloadTorrentQuery),
|
||||
|
||||
@@ -22,7 +22,7 @@ pub struct GetUserQuery {
|
||||
|
||||
#[utoipa::path(
|
||||
get,
|
||||
operation_id = "Get users",
|
||||
operation_id = "Get user",
|
||||
tag = "User",
|
||||
path = "/api/users",
|
||||
params(GetUserQuery),
|
||||
|
||||
@@ -11,7 +11,7 @@ use arcadia_storage::{
|
||||
|
||||
#[utoipa::path(
|
||||
post,
|
||||
operation_id = "Warn users",
|
||||
operation_id = "Warn user",
|
||||
tag = "User",
|
||||
path = "/api/users/warnings",
|
||||
security(
|
||||
|
||||
@@ -20,8 +20,8 @@ Arcadia's frontend is a [SPA](https://developer.mozilla.org/en-US/docs/Glossary/
|
||||
|
||||
## API Schema Updates
|
||||
|
||||
If you make changes to structs that are listed in the swagger, you must regenerate the typescript interfaces with this command (from the frontend directory, while the backend is running):
|
||||
If you make changes to structs that are listed in the swagger or the api routes, you must regenerate the typescript interfaces with this command (from the frontend directory, while the backend is running):
|
||||
|
||||
```bash
|
||||
npx openapi-typescript http://127.0.0.1:8080/swagger-json/openapi.json -o ./src/api-schema/schema.d.ts
|
||||
npx openapi-generator-cli generate -g typescript-axios -i http://127.0.0.1:8080/swagger-json/openapi.json -o ./src/services/api-schema -t .openapi-generator/templates --config .openapi-generator/openapi-generator.config.json --global-property=models,apiDocs=false,modelDocs=false,skipFormModel=false
|
||||
```
|
||||
|
||||
@@ -1,11 +1,3 @@
|
||||
# The base URL for the API that the frontend will communicate with.
|
||||
# Ensure this matches the backend's API endpoint.
|
||||
VITE_API_BASE_URL=http://127.0.0.1:8080/api
|
||||
|
||||
# The name of the site displayed in the frontend.
|
||||
# You can customize this to reflect your application's branding.
|
||||
VITE_API_BASE_URL=http://127.0.0.1:8080
|
||||
VITE_SITE_NAME="Arcadia"
|
||||
|
||||
# If set to true, any unauthenticated user will be redirected to it
|
||||
# What will be loaded is public/home/index.html
|
||||
VITE_ENABLE_CUSTOM_FRONT_PAGE=false
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# The base URL for the API that the frontend will communicate with.
|
||||
# No trailing slash
|
||||
VITE_API_BASE_URL=http://127.0.0.1:8080/api
|
||||
VITE_API_BASE_URL=http://127.0.0.1:8080
|
||||
|
||||
# The name of the site displayed in the frontend.
|
||||
# You can customize this to reflect your application's branding.
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"modelPropertyNaming": "camelCase",
|
||||
"supportsES6": true
|
||||
}
|
||||
86
frontend/.openapi-generator/templates/api.mustache
Normal file
86
frontend/.openapi-generator/templates/api.mustache
Normal file
@@ -0,0 +1,86 @@
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
{{>licenseInfo}}
|
||||
|
||||
import type { Configuration } from './configuration';
|
||||
import type { AxiosPromise, AxiosInstance, RawAxiosRequestConfig } from 'axios';
|
||||
import { default as globalAxios } from '../api/api';
|
||||
|
||||
// Standard imports
|
||||
{{#withNodeImports}}
|
||||
// @ts-ignore
|
||||
import { URL, URLSearchParams } from 'url';
|
||||
{{#multipartFormData}}
|
||||
import FormData from 'form-data'
|
||||
{{/multipartFormData}}
|
||||
{{/withNodeImports}}
|
||||
// @ts-ignore
|
||||
import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction{{#withAWSV4Signature}}, setAWS4SignatureInterceptor{{/withAWSV4Signature}} } from './common';
|
||||
import type { RequestArgs } from './base';
|
||||
// @ts-ignore
|
||||
import { BASE_PATH, COLLECTION_FORMATS, BaseAPI, RequiredError, operationServerMap } from './base';
|
||||
|
||||
{{#models}}
|
||||
{{#model}}{{#isEnum}}{{>modelEnum}}{{/isEnum}}{{#oneOf}}{{#-first}}{{>modelOneOf}}{{/-first}}{{/oneOf}}{{^isEnum}}{{^oneOf}}{{>modelGeneric}}{{/oneOf}}{{/isEnum}}{{/model}}
|
||||
{{/models}}
|
||||
|
||||
{{! ---------------------------------------------------------------------- }}
|
||||
{{! CASE 1: Single File Generation }}
|
||||
{{! ---------------------------------------------------------------------- }}
|
||||
{{^withSeparateModelsAndApi}}
|
||||
{{#apiInfo}}{{#apis}}
|
||||
{{>apiInner}}
|
||||
|
||||
export const {{#lambda.camelcase}}{{classname}}{{/lambda.camelcase}} = new {{classname}}(undefined, undefined, globalAxios);
|
||||
|
||||
{{#operations}}
|
||||
{{#operation}}
|
||||
{{! 1. Request Interface (Only for multiple params) }}
|
||||
{{#allParams}}{{#-first}}{{^-last}}
|
||||
export interface {{#lambda.titlecase}}{{operationId}}{{/lambda.titlecase}}Request {
|
||||
{{#allParams}}
|
||||
/** {{description}} */
|
||||
'{{baseName}}'{{^required}}?{{/required}}: {{{dataType}}}{{^required}} | null{{/required}};
|
||||
{{/allParams}}
|
||||
}
|
||||
{{/-last}}{{/-first}}{{/allParams}}
|
||||
|
||||
{{! 2. Function Definition (Compacted to remove whitespace) }}
|
||||
export const {{operationId}} = async ({{#allParams}}{{#-first}}{{#-last}}{{paramName}}{{^required}}?{{/required}}: {{{dataType}}}{{^required}} | null{{/required}}, {{/-last}}{{/-first}}{{#-first}}{{^-last}}requestParameters: {{#lambda.titlecase}}{{operationId}}{{/lambda.titlecase}}Request, {{/-last}}{{/-first}}{{/allParams}}options?: RawAxiosRequestConfig): Promise<{{{returnType}}}{{^returnType}}void{{/returnType}}> => {
|
||||
const response = await {{#lambda.camelcase}}{{classname}}{{/lambda.camelcase}}.{{operationId}}({{#allParams}}{{#-first}}{{#-last}}{{paramName}}, {{/-last}}{{/-first}}{{^-last}}requestParameters['{{baseName}}']!, {{/-last}}{{^-first}}{{#-last}}requestParameters['{{baseName}}']!, {{/-last}}{{/-first}}{{/allParams}}options);
|
||||
return response.data;
|
||||
};
|
||||
{{/operation}}
|
||||
{{/operations}}
|
||||
|
||||
{{/apis}}{{/apiInfo}}
|
||||
{{/withSeparateModelsAndApi}}
|
||||
|
||||
{{! ---------------------------------------------------------------------- }}
|
||||
{{! CASE 2: Separate Files Generation }}
|
||||
{{! ---------------------------------------------------------------------- }}
|
||||
{{#withSeparateModelsAndApi}}
|
||||
{{>apiInner}}
|
||||
|
||||
export const {{#lambda.camelcase}}{{classname}}{{/lambda.camelcase}} = new {{classname}}(undefined, undefined, globalAxios);
|
||||
|
||||
{{#operations}}
|
||||
{{#operation}}
|
||||
{{! 1. Request Interface (Only for multiple params) }}
|
||||
{{#allParams}}{{#-first}}{{^-last}}
|
||||
export interface {{#lambda.titlecase}}{{operationId}}{{/lambda.titlecase}}Request {
|
||||
{{#allParams}}
|
||||
/** {{description}} */
|
||||
'{{baseName}}'{{^required}}?{{/required}}: {{{dataType}}}{{^required}} | null{{/required}};
|
||||
{{/allParams}}
|
||||
}
|
||||
{{/-last}}{{/-first}}{{/allParams}}
|
||||
|
||||
{{! 2. Function Definition (Compacted to remove whitespace) }}
|
||||
export const {{operationId}} = async ({{#allParams}}{{#-first}}{{#-last}}{{paramName}}{{^required}}?{{/required}}: {{{dataType}}}{{^required}} | null{{/required}}, {{/-last}}{{/-first}}{{#-first}}{{^-last}}requestParameters: {{#lambda.titlecase}}{{operationId}}{{/lambda.titlecase}}Request, {{/-last}}{{/-first}}{{/allParams}}options?: RawAxiosRequestConfig): Promise<{{{returnType}}}{{^returnType}}void{{/returnType}}> => {
|
||||
const response = await {{#lambda.camelcase}}{{classname}}{{/lambda.camelcase}}.{{operationId}}({{#allParams}}{{#-first}}{{#-last}}{{paramName}}, {{/-last}}{{/-first}}{{^-last}}requestParameters['{{baseName}}']!, {{/-last}}{{^-first}}{{#-last}}requestParameters['{{baseName}}']!, {{/-last}}{{/-first}}{{/allParams}}options);
|
||||
return response.data;
|
||||
};
|
||||
{{/operation}}
|
||||
{{/operations}}
|
||||
{{/withSeparateModelsAndApi}}
|
||||
@@ -1 +1 @@
|
||||
src/api-schema/schema.d.ts
|
||||
src/services/api-schema/
|
||||
|
||||
@@ -18,7 +18,7 @@ export default defineConfigWithVueTs(
|
||||
|
||||
{
|
||||
name: 'app/files-to-ignore',
|
||||
ignores: ['**/dist/**', '**/dist-ssr/**', '**/coverage/**'],
|
||||
ignores: ['**/dist/**', '**/dist-ssr/**', '**/coverage/**', 'src/services/api-schema/**'],
|
||||
},
|
||||
|
||||
pluginVue.configs['flat/essential'],
|
||||
|
||||
7
frontend/openapitools.json
Normal file
7
frontend/openapitools.json
Normal file
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"$schema": "./node_modules/@openapitools/openapi-generator-cli/config.schema.json",
|
||||
"spaces": 2,
|
||||
"generator-cli": {
|
||||
"version": "7.17.0"
|
||||
}
|
||||
}
|
||||
1513
frontend/package-lock.json
generated
1513
frontend/package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -20,6 +20,7 @@
|
||||
"dependencies": {
|
||||
"@bbob/html": "^4.3.1",
|
||||
"@bbob/preset-html5": "^4.3.1",
|
||||
"@openapitools/openapi-generator-cli": "^2.25.2",
|
||||
"@primeuix/themes": "^1.0.0",
|
||||
"@primevue/forms": "^4.3.3",
|
||||
"axios": "^1.8.3",
|
||||
|
||||
@@ -22,12 +22,12 @@ import SearchBars from './components/SearchBars.vue'
|
||||
import NotificationToasts from './components/NotificationToasts.vue'
|
||||
import { Toast } from 'primevue'
|
||||
import { useUserStore } from './stores/user'
|
||||
import { getMe } from './services/api/userService'
|
||||
import { ref } from 'vue'
|
||||
import { useRoute } from 'vue-router'
|
||||
import FooterBar from './components/FooterBar.vue'
|
||||
import { useNotificationsStore } from './stores/notifications'
|
||||
import { isRouteProtected } from './services/helpers'
|
||||
import { getMe } from './services/api-schema'
|
||||
|
||||
// enable dark mode by default
|
||||
document.documentElement.classList.add('dark-theme')
|
||||
@@ -80,7 +80,7 @@ const getAppReady = async (forceGetUser: boolean = false) => {
|
||||
// load custom css sheet
|
||||
const head = document.getElementsByTagName('head')[0]
|
||||
const style = document.createElement('link')
|
||||
style.href = `${import.meta.env.VITE_API_BASE_URL.replace(/\/api$/, '')}/css/${profile.user.css_sheet_name}.css`
|
||||
style.href = `${import.meta.env.VITE_API_BASE_URL}/css/${profile.user.css_sheet_name}.css`
|
||||
style.type = 'text/css'
|
||||
style.rel = 'stylesheet'
|
||||
head.append(style)
|
||||
|
||||
5177
frontend/src/api-schema/schema.d.ts
vendored
5177
frontend/src/api-schema/schema.d.ts
vendored
File diff suppressed because it is too large
Load Diff
@@ -18,7 +18,7 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { getCssSheets, type CssSheet } from '@/services/api/cssSheetService'
|
||||
import { getCSSSheets, type CssSheet } from '@/services/api-schema'
|
||||
import { onMounted, ref } from 'vue'
|
||||
import { useI18n } from 'vue-i18n'
|
||||
|
||||
@@ -35,7 +35,7 @@ const cssSheets = ref<CssSheet[]>([])
|
||||
const defaultSheetName = ref<string>('')
|
||||
|
||||
onMounted(() => {
|
||||
getCssSheets().then((sheets) => {
|
||||
getCSSSheets().then((sheets) => {
|
||||
cssSheets.value = sheets.css_sheets
|
||||
defaultSheetName.value = sheets.default_sheet_name
|
||||
})
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { type TitleGroup, type TitleGroupLite } from '@/services/api/titleGroupService'
|
||||
import type { TitleGroup, TitleGroupLite } from '@/services/api-schema'
|
||||
|
||||
defineProps<{
|
||||
title_group: TitleGroup | TitleGroupLite
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { computed, defineProps, ref } from 'vue'
|
||||
import { computed, ref } from 'vue'
|
||||
import PaginationSelector from './PaginationSelector.vue'
|
||||
import { onMounted } from 'vue'
|
||||
import { useRouter } from 'vue-router'
|
||||
|
||||
@@ -25,7 +25,7 @@ import ArtistSearchBar from './artist/ArtistSearchBar.vue'
|
||||
import { ref } from 'vue'
|
||||
import { useI18n } from 'vue-i18n'
|
||||
import { useRouter } from 'vue-router'
|
||||
import type { ArtistLite } from '@/services/api/artistService'
|
||||
import type { ArtistLite } from '@/services/api-schema'
|
||||
|
||||
const { t } = useI18n()
|
||||
const router = useRouter()
|
||||
|
||||
@@ -16,9 +16,9 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import type { AffiliatedArtistHierarchy } from '@/services/api/artistService'
|
||||
import { useI18n } from 'vue-i18n'
|
||||
import ImagePreview from '../ImagePreview.vue'
|
||||
import type { AffiliatedArtistHierarchy } from '@/services/api-schema'
|
||||
|
||||
const { t } = useI18n()
|
||||
|
||||
|
||||
@@ -15,9 +15,9 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import type { AffiliatedEntityHierarchy } from '@/services/api/entityService'
|
||||
import { useI18n } from 'vue-i18n'
|
||||
import ImagePreview from '../ImagePreview.vue'
|
||||
import type { AffiliatedEntityHierarchy } from '@/services/api-schema'
|
||||
|
||||
const { t } = useI18n()
|
||||
|
||||
|
||||
@@ -14,8 +14,8 @@
|
||||
<script setup lang="ts">
|
||||
import ContentContainer from '@/components/ContentContainer.vue'
|
||||
import BBCodeRenderer from '@/components/community/BBCodeRenderer.vue'
|
||||
import { type Artist } from '@/services/api/artistService'
|
||||
import type ImagePreview from '../ImagePreview.vue'
|
||||
import type { Artist } from '@/services/api-schema'
|
||||
|
||||
defineProps<{
|
||||
artist: Artist
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
<script lang="ts" setup>
|
||||
import { ref, watch } from 'vue'
|
||||
import { AutoComplete, type AutoCompleteOptionSelectEvent } from 'primevue'
|
||||
import { searchArtistsLite, type ArtistLite } from '@/services/api/artistService'
|
||||
import { searchArtists, type ArtistLite } from '@/services/api-schema'
|
||||
|
||||
const props = defineProps<{
|
||||
placeholder: string
|
||||
@@ -60,7 +60,7 @@ const onInput = () => {
|
||||
|
||||
const search = () => {
|
||||
if (name.value !== '') {
|
||||
searchArtistsLite(name.value).then((artists) => {
|
||||
searchArtists(name.value).then((artists) => {
|
||||
foundArtists.value = artists
|
||||
})
|
||||
} else {
|
||||
|
||||
@@ -11,9 +11,9 @@
|
||||
<script setup lang="ts">
|
||||
import ContentContainer from '@/components/ContentContainer.vue'
|
||||
import BBCodeRenderer from '@/components/community/BBCodeRenderer.vue'
|
||||
import { type Artist } from '@/services/api/artistService'
|
||||
import { useI18n } from 'vue-i18n'
|
||||
import ImagePreview from '../ImagePreview.vue'
|
||||
import type { Artist } from '@/services/api-schema'
|
||||
|
||||
const { t } = useI18n()
|
||||
|
||||
|
||||
@@ -17,12 +17,12 @@
|
||||
</Dialog>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { type Artist, type EditedArtist } from '@/services/api/artistService'
|
||||
import { useUserStore } from '@/stores/user'
|
||||
import { useI18n } from 'vue-i18n'
|
||||
import { ref } from 'vue'
|
||||
import Dialog from 'primevue/dialog'
|
||||
import EditArtistDialog from './EditArtistDialog.vue'
|
||||
import type { Artist, EditedArtist } from '@/services/api-schema'
|
||||
|
||||
const { t } = useI18n()
|
||||
const userStore = useUserStore()
|
||||
|
||||
@@ -42,12 +42,17 @@ import { Button, InputText, MultiSelect } from 'primevue'
|
||||
import ArtistSearchBar from './ArtistSearchBar.vue'
|
||||
import { getArtistRoles } from '@/services/helpers'
|
||||
import { ref } from 'vue'
|
||||
import type { AffiliatedArtistHierarchy, ArtistLite, UserCreatedAffiliatedArtist } from '@/services/api/artistService'
|
||||
import { useI18n } from 'vue-i18n'
|
||||
import type { ContentType } from '@/services/api/titleGroupService'
|
||||
import { onMounted } from 'vue'
|
||||
import { toRaw } from 'vue'
|
||||
import { type UserCreatedArtist, createArtists } from '@/services/api/artistService'
|
||||
import {
|
||||
createArtists,
|
||||
type AffiliatedArtistHierarchy,
|
||||
type ArtistLite,
|
||||
type ContentType,
|
||||
type UserCreatedAffiliatedArtist,
|
||||
type UserCreatedArtist,
|
||||
} from '@/services/api-schema'
|
||||
|
||||
const { t } = useI18n()
|
||||
|
||||
|
||||
@@ -24,12 +24,12 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { editArtist, type Artist, type EditedArtist } from '@/services/api/artistService'
|
||||
import { FloatLabel, InputText } from 'primevue'
|
||||
import Button from 'primevue/button'
|
||||
import { ref, onMounted, toRaw } from 'vue'
|
||||
import { useI18n } from 'vue-i18n'
|
||||
import BBCodeEditor from '../community/BBCodeEditor.vue'
|
||||
import { editArtist, type Artist, type EditedArtist } from '@/services/api-schema'
|
||||
|
||||
const { t } = useI18n()
|
||||
|
||||
|
||||
@@ -11,18 +11,18 @@
|
||||
</div>
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
import {
|
||||
type AffiliatedArtistHierarchy,
|
||||
removeArtistAffiliations,
|
||||
createArtistAffiliation,
|
||||
type UserCreatedAffiliatedArtist,
|
||||
} from '@/services/api/artistService'
|
||||
import EditAffiliatedArtists from './EditAffiliatedArtists.vue'
|
||||
import type { ContentType } from '@/services/api/titleGroupService'
|
||||
import { Button } from 'primevue'
|
||||
import { ref } from 'vue'
|
||||
import { useI18n } from 'vue-i18n'
|
||||
import type { VNodeRef } from 'vue'
|
||||
import {
|
||||
createArtistAffiliation,
|
||||
deleteArtistAffiliation,
|
||||
type AffiliatedArtistHierarchy,
|
||||
type ContentType,
|
||||
type UserCreatedAffiliatedArtist,
|
||||
} from '@/services/api-schema'
|
||||
|
||||
const { t } = useI18n()
|
||||
const editAffiliatedArtistsRef = ref<VNodeRef | null>(null)
|
||||
@@ -44,7 +44,13 @@ const sendEdits = async () => {
|
||||
loading.value = true
|
||||
await editAffiliatedArtistsRef.value.createInexistingArtists()
|
||||
if (editAffiliatedArtistsRef.value.removedExistingAffiliatedArtistsIds.length > 0) {
|
||||
await removeArtistAffiliations(editAffiliatedArtistsRef.value.removedExistingAffiliatedArtistsIds)
|
||||
// await removeArtistAffiliations()
|
||||
|
||||
const params = new URLSearchParams()
|
||||
editAffiliatedArtistsRef.value.removedExistingAffiliatedArtistsIds.forEach((id: number) => {
|
||||
params.append('affiliation_ids', id.toString())
|
||||
})
|
||||
await deleteArtistAffiliation({ params })
|
||||
}
|
||||
const affiliationsToCreate = editAffiliatedArtistsRef.value.affiliated_artists
|
||||
.filter((aa: UserCreatedAffiliatedArtist | AffiliatedArtistHierarchy) => !('id' in aa))
|
||||
|
||||
@@ -11,9 +11,9 @@ import InputText from 'primevue/inputtext'
|
||||
import { Textarea } from 'primevue'
|
||||
import { Form } from '@primevue/forms'
|
||||
import Button from 'primevue/button'
|
||||
import { postUserApplication, type UserCreatedUserApplication } from '@/services/api/userApplicationService'
|
||||
import { useI18n } from 'vue-i18n'
|
||||
import { ref } from 'vue'
|
||||
import { createUserApplication, type UserCreatedUserApplication } from '@/services/api-schema'
|
||||
|
||||
const form = ref<UserCreatedUserApplication>({
|
||||
email: '',
|
||||
@@ -27,7 +27,7 @@ const { t } = useI18n()
|
||||
|
||||
const handleLogin = async () => {
|
||||
loading.value = true
|
||||
postUserApplication(form.value)
|
||||
createUserApplication(form.value)
|
||||
.then(() => {
|
||||
form.value.email = ''
|
||||
form.value.body = ''
|
||||
|
||||
@@ -15,10 +15,10 @@ import Password from 'primevue/password'
|
||||
import { Form } from '@primevue/forms'
|
||||
import Button from 'primevue/button'
|
||||
import Checkbox from 'primevue/checkbox'
|
||||
import { login, type Login } from '@/services/api/authService'
|
||||
import { useRouter } from 'vue-router'
|
||||
import { useI18n } from 'vue-i18n'
|
||||
import { ref } from 'vue'
|
||||
import { login, type Login } from '@/services/api-schema'
|
||||
|
||||
const form = ref<Login>({
|
||||
username: '',
|
||||
|
||||
@@ -39,11 +39,11 @@ import Password from 'primevue/password'
|
||||
import Button from 'primevue/button'
|
||||
import { ref } from 'vue'
|
||||
import { useRouter } from 'vue-router'
|
||||
import { register, type Register } from '@/services/api/authService'
|
||||
import { useI18n } from 'vue-i18n'
|
||||
import { useRoute } from 'vue-router'
|
||||
import { Form, type FormResolverOptions, type FormSubmitEvent } from '@primevue/forms'
|
||||
import { Message } from 'primevue'
|
||||
import { register, type Register } from '@/services/api-schema'
|
||||
|
||||
const formRef = ref()
|
||||
|
||||
@@ -66,7 +66,7 @@ const handleRegister = async ({ valid }: FormSubmitEvent) => {
|
||||
}
|
||||
loading.value = true
|
||||
try {
|
||||
await register(form.value, (route.query.invitation_key as string) ?? '')
|
||||
await register(form.value, { params: { invitation_key: (route.query.invitation_key as string) ?? '' } })
|
||||
router.push('/login')
|
||||
} catch (error) {
|
||||
console.error('Registration failed:', error)
|
||||
|
||||
@@ -21,11 +21,11 @@
|
||||
<script setup lang="ts">
|
||||
import { InputText, Button } from 'primevue'
|
||||
import { useI18n } from 'vue-i18n'
|
||||
import { createCollageEntries, type CollageEntry, type UserCreatedCollageEntry, type CollageLite } from '@/services/api/collageService'
|
||||
import { ref } from 'vue'
|
||||
import { onMounted } from 'vue'
|
||||
import CollageSearchBar from './CollageSearchBar.vue'
|
||||
import { getHostname } from '@/services/helpers'
|
||||
import { insertsEntriesIntoACollage, type CollageEntry, type CollageLite, type UserCreatedCollageEntry } from '@/services/api-schema'
|
||||
|
||||
const { t } = useI18n()
|
||||
|
||||
@@ -51,7 +51,7 @@ const sendCollageEntries = async () => {
|
||||
}
|
||||
}
|
||||
})
|
||||
createCollageEntries(newCollageEntries.value)
|
||||
insertsEntriesIntoACollage(newCollageEntries.value)
|
||||
.then((data) => {
|
||||
emit('addedEntries', data)
|
||||
})
|
||||
|
||||
@@ -16,9 +16,9 @@
|
||||
<script setup lang="ts">
|
||||
import { InputText, Button } from 'primevue'
|
||||
import { useI18n } from 'vue-i18n'
|
||||
import { createCollageEntries, type CollageEntry, type CollageType, type UserCreatedCollageEntry } from '@/services/api/collageService'
|
||||
import { ref } from 'vue'
|
||||
import { onMounted } from 'vue'
|
||||
import { insertsEntriesIntoACollage, type CollageEntry, type CollageType, type UserCreatedCollageEntry } from '@/services/api-schema'
|
||||
|
||||
const { t } = useI18n()
|
||||
|
||||
@@ -44,7 +44,7 @@ const sendCollageEntries = async () => {
|
||||
}
|
||||
}
|
||||
})
|
||||
createCollageEntries(newCollageEntries.value)
|
||||
insertsEntriesIntoACollage(newCollageEntries.value)
|
||||
.then((data) => {
|
||||
emit('addedEntries', data)
|
||||
})
|
||||
|
||||
@@ -17,9 +17,9 @@
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { AutoComplete } from 'primevue'
|
||||
import { type CollageLite, type SearchCollagesLiteQuery, searchCollagesLite } from '@/services/api/collageService'
|
||||
import { ref } from 'vue'
|
||||
import { getHostname } from '@/services/helpers'
|
||||
import { searchCollagesLite, type CollageLite, type SearchCollagesLiteQuery } from '@/services/api-schema'
|
||||
|
||||
const emit = defineEmits<{
|
||||
collageSelected: [CollageLite]
|
||||
|
||||
@@ -12,12 +12,12 @@
|
||||
</ContentContainer>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { searchCollages, type PaginatedResults_CollageSearchResult, type SearchCollagesQuery } from '@/services/api/collageService'
|
||||
import ContentContainer from '../ContentContainer.vue'
|
||||
import { InputText, Button, FloatLabel } from 'primevue'
|
||||
import { Form } from '@primevue/forms'
|
||||
import { onMounted, ref } from 'vue'
|
||||
import { useI18n } from 'vue-i18n'
|
||||
import { searchCollages, type PaginatedResultsCollageSearchResult, type SearchCollagesQuery } from '@/services/api-schema'
|
||||
|
||||
const { t } = useI18n()
|
||||
|
||||
@@ -28,7 +28,7 @@ const form = ref<SearchCollagesQuery>({
|
||||
tags: [],
|
||||
})
|
||||
const loading = ref(false)
|
||||
const collageSearchResponse = ref<PaginatedResults_CollageSearchResult>()
|
||||
const collageSearchResponse = ref<PaginatedResultsCollageSearchResult>()
|
||||
|
||||
onMounted(async () => {
|
||||
await fetchCollages()
|
||||
@@ -41,7 +41,7 @@ const fetchCollages = async () => {
|
||||
}
|
||||
|
||||
const emit = defineEmits<{
|
||||
gotResults: [PaginatedResults_CollageSearchResult]
|
||||
gotResults: [PaginatedResultsCollageSearchResult]
|
||||
}>()
|
||||
|
||||
// defineProps<{
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
</div>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import type { Collage } from '@/services/api/collageService'
|
||||
import type { Collage } from '@/services/api-schema'
|
||||
import ContentContainer from '../ContentContainer.vue'
|
||||
import { useI18n } from 'vue-i18n'
|
||||
|
||||
|
||||
@@ -35,9 +35,9 @@
|
||||
import { Column, DataTable } from 'primevue'
|
||||
import { RouterLink } from 'vue-router'
|
||||
import { useI18n } from 'vue-i18n'
|
||||
import type { CollageSearchResult } from '@/services/api/collageService'
|
||||
import UsernameEnriched from '../user/UsernameEnriched.vue'
|
||||
import { timeAgo } from '@/services/helpers'
|
||||
import type { CollageSearchResult } from '@/services/api-schema'
|
||||
|
||||
defineProps<{
|
||||
collages: CollageSearchResult[]
|
||||
|
||||
@@ -28,11 +28,9 @@
|
||||
<script setup lang="ts">
|
||||
import ContentContainer from '@/components/ContentContainer.vue'
|
||||
import BBCodeRenderer from '@/components/community/BBCodeRenderer.vue'
|
||||
import type { TitleGroupCommentHierarchy } from '@/services/api/commentService'
|
||||
import { timeAgo } from '@/services/helpers'
|
||||
import type { ForumPostHierarchy } from '@/services/api/forumService'
|
||||
import type { ConversationMessageHierarchy } from '@/services/api/conversationService'
|
||||
import UsernameEnriched from '../user/UsernameEnriched.vue'
|
||||
import type { ConversationMessageHierarchy, ForumPostHierarchy, TitleGroupCommentHierarchy } from '@/services/api-schema'
|
||||
|
||||
defineProps<{
|
||||
comment: TitleGroupCommentHierarchy | ForumPostHierarchy | ConversationMessageHierarchy
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import type { ConversationMessageHierarchy } from '@/services/api/conversationService'
|
||||
import type { ConversationMessageHierarchy } from '@/services/api-schema'
|
||||
import GeneralComment from '../community/GeneralComment.vue'
|
||||
import { useUserStore } from '@/stores/user'
|
||||
|
||||
|
||||
@@ -143,10 +143,9 @@ import Message from 'primevue/message'
|
||||
import { Form, type FormResolverOptions, type FormSubmitEvent } from '@primevue/forms'
|
||||
import { useI18n } from 'vue-i18n'
|
||||
import { getSources } from '@/services/helpers'
|
||||
import type { UserCreatedEditionGroup } from '@/services/api/editionGroupService'
|
||||
import type { VNodeRef } from 'vue'
|
||||
import { useEditionGroupStore } from '@/stores/editionGroup'
|
||||
import type { TitleGroupLite } from '@/services/api/titleGroupService'
|
||||
import type { TitleGroupLite, UserCreatedEditionGroup } from '@/services/api-schema'
|
||||
|
||||
interface Props {
|
||||
titleGroup: TitleGroupLite
|
||||
|
||||
@@ -35,14 +35,14 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref } from 'vue'
|
||||
import { ref, toRaw } from 'vue'
|
||||
import FloatLabel from 'primevue/floatlabel'
|
||||
import Select from 'primevue/select'
|
||||
import { createEditionGroup, type EditionGroup, type EditionGroupInfoLite, type UserCreatedEditionGroup } from '@/services/api/editionGroupService'
|
||||
import { useTitleGroupStore } from '@/stores/titleGroup'
|
||||
import CreateOrEditEditionGroup from './CreateOrEditEditionGroup.vue'
|
||||
import { getEditionGroupSlug } from '@/services/helpers'
|
||||
import { useI18n } from 'vue-i18n'
|
||||
import { createEditionGroup, type EditionGroup, type EditionGroupInfoLite, type UserCreatedEditionGroup } from '@/services/api-schema'
|
||||
|
||||
const action = ref<'create' | 'select'>('select')
|
||||
|
||||
@@ -66,9 +66,18 @@ const editionGroupSelected = () => {
|
||||
}
|
||||
const sendEditionGroup = (editionGroupForm?: UserCreatedEditionGroup) => {
|
||||
creatingEditionGroup.value = true
|
||||
const formattededitionGroupForm = JSON.parse(JSON.stringify(editionGroupForm))
|
||||
const formattededitionGroupForm = structuredClone(toRaw(editionGroupForm))
|
||||
if (!formattededitionGroupForm) return
|
||||
// otherwise there is a json parse error, last char is "Z"
|
||||
// formattededitionGroupForm.release_date = formattededitionGroupForm.release_date.slice(0, -1)
|
||||
|
||||
formattededitionGroupForm.additional_information = formattededitionGroupForm.additional_information
|
||||
? Object.fromEntries(Object.entries(formattededitionGroupForm.additional_information).filter(([, value]) => value !== null && value !== ''))
|
||||
: {}
|
||||
formattededitionGroupForm.covers = formattededitionGroupForm.covers.filter((cover) => cover.trim() !== '')
|
||||
formattededitionGroupForm.external_links = formattededitionGroupForm.external_links.filter((link) => link.trim() !== '')
|
||||
formattededitionGroupForm.distributor = formattededitionGroupForm.distributor == '' ? null : formattededitionGroupForm.distributor
|
||||
|
||||
createEditionGroup(formattededitionGroupForm)
|
||||
.then((data: EditionGroup) => {
|
||||
emit('done', data)
|
||||
|
||||
@@ -6,10 +6,10 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import type { ForumPostAndThreadName } from '@/services/api/homeService'
|
||||
import ContentContainer from '../ContentContainer.vue'
|
||||
import { timeAgo } from '@/services/helpers'
|
||||
import BBCodeRenderer from '../community/BBCodeRenderer.vue'
|
||||
import type { ForumPostAndThreadName } from '@/services/api-schema'
|
||||
|
||||
defineProps<{
|
||||
announcement: ForumPostAndThreadName
|
||||
|
||||
@@ -31,12 +31,12 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import type { ForumCategoryHierarchy } from '@/services/api/forumService'
|
||||
import { useI18n } from 'vue-i18n'
|
||||
import DataTable from 'primevue/datatable'
|
||||
import Column from 'primevue/column'
|
||||
import { timeAgo } from '@/services/helpers'
|
||||
import { RouterLink } from 'vue-router'
|
||||
import type { ForumCategoryHierarchy } from '@/services/api-schema'
|
||||
|
||||
defineProps<{
|
||||
forumCategory: ForumCategoryHierarchy
|
||||
|
||||
@@ -40,11 +40,11 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import type { ForumSearchResult } from '@/services/api/forumService'
|
||||
import { timeAgo } from '@/services/helpers'
|
||||
import { Column, DataTable } from 'primevue'
|
||||
import { useI18n } from 'vue-i18n'
|
||||
import ForumThreadName from './ForumThreadName.vue'
|
||||
import type { ForumSearchResult } from '@/services/api-schema'
|
||||
|
||||
const { t } = useI18n()
|
||||
|
||||
|
||||
@@ -22,7 +22,6 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { getNotificationsForumThreadPosts, type NotificationForumThreadPost } from '@/services/api/notificationService'
|
||||
import { Column, DataTable } from 'primevue'
|
||||
import { ref } from 'vue'
|
||||
import { onMounted } from 'vue'
|
||||
@@ -30,6 +29,7 @@ import { useI18n } from 'vue-i18n'
|
||||
import ForumThreadName from '../forum/ForumThreadName.vue'
|
||||
import { timeAgo } from '@/services/helpers'
|
||||
import { useNotificationsStore } from '@/stores/notifications'
|
||||
import { getNotificationsForForumThreadPosts, type NotificationForumThreadPost } from '@/services/api-schema'
|
||||
|
||||
const notificationsStore = useNotificationsStore()
|
||||
const { t } = useI18n()
|
||||
@@ -38,7 +38,7 @@ const includeRead = ref(false)
|
||||
const notifications = ref<NotificationForumThreadPost[]>([])
|
||||
|
||||
const fetchNotifications = async () => {
|
||||
getNotificationsForumThreadPosts(includeRead.value).then((n) => {
|
||||
getNotificationsForForumThreadPosts(includeRead.value).then((n) => {
|
||||
notifications.value = n
|
||||
})
|
||||
}
|
||||
|
||||
@@ -15,8 +15,8 @@
|
||||
<script setup lang="ts">
|
||||
import ContentContainer from '@/components/ContentContainer.vue'
|
||||
import BBCodeRenderer from '@/components/community/BBCodeRenderer.vue'
|
||||
import type { Series } from '@/services/api/seriesService'
|
||||
import ImagePreview from '../ImagePreview.vue'
|
||||
import type { Series } from '@/services/api-schema'
|
||||
|
||||
defineProps<{
|
||||
series: Series
|
||||
|
||||
@@ -12,12 +12,12 @@
|
||||
</ContentContainer>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { searchSeries, type SeriesSearchResponse, type SearchSeriesQuery } from '@/services/api/seriesService'
|
||||
import ContentContainer from '../ContentContainer.vue'
|
||||
import { InputText, Button, FloatLabel } from 'primevue'
|
||||
import { Form } from '@primevue/forms'
|
||||
import { onMounted, ref } from 'vue'
|
||||
import { useI18n } from 'vue-i18n'
|
||||
import { searchSeries, type SearchSeriesQuery, type SeriesSearchResponse } from '@/services/api-schema'
|
||||
|
||||
const { t } = useI18n()
|
||||
|
||||
|
||||
@@ -12,8 +12,8 @@
|
||||
<script setup lang="ts">
|
||||
import ContentContainer from '@/components/ContentContainer.vue'
|
||||
import BBCodeRenderer from '@/components/community/BBCodeRenderer.vue'
|
||||
import type { Series } from '@/services/api/seriesService'
|
||||
import ImagePreview from '../ImagePreview.vue'
|
||||
import type { Series } from '@/services/api-schema'
|
||||
|
||||
defineProps<{
|
||||
series: Series
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import type { Series } from '@/services/api/seriesService'
|
||||
import type { Series } from '@/services/api-schema'
|
||||
|
||||
defineProps<{
|
||||
series: Series
|
||||
|
||||
@@ -23,8 +23,8 @@
|
||||
import { Column, DataTable } from 'primevue'
|
||||
import { RouterLink } from 'vue-router'
|
||||
import { useI18n } from 'vue-i18n'
|
||||
import type { SeriesSearchResult } from '@/services/api/seriesService'
|
||||
import ImagePreview from '../ImagePreview.vue'
|
||||
import type { SeriesSearchResult } from '@/services/api-schema'
|
||||
|
||||
defineProps<{
|
||||
series: SeriesSearchResult[]
|
||||
|
||||
@@ -32,7 +32,6 @@
|
||||
</Dialog>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { updateUserApplication, type UserApplication, type UserApplicationStatus } from '@/services/api/userApplicationService'
|
||||
import { useI18n } from 'vue-i18n'
|
||||
import ContentContainer from '../ContentContainer.vue'
|
||||
import { Dialog } from 'primevue'
|
||||
@@ -40,6 +39,7 @@ import { Button } from 'primevue'
|
||||
import SendInvitationDialog from '../user/SendInvitationDialog.vue'
|
||||
import { timeAgo } from '@/services/helpers'
|
||||
import { ref } from 'vue'
|
||||
import { updateUserApplicationStatus, type UserApplication, type UserApplicationStatus } from '@/services/api-schema'
|
||||
|
||||
const { t } = useI18n()
|
||||
|
||||
@@ -58,7 +58,7 @@ const updateApplication = (status: UserApplicationStatus) => {
|
||||
if (status === 'rejected') {
|
||||
rejectLoading.value = true
|
||||
}
|
||||
updateUserApplication({ status: status, user_application_id: props.userApplication.id })
|
||||
updateUserApplicationStatus({ status: status, user_application_id: props.userApplication.id })
|
||||
.then((updatedApplication) => {
|
||||
emit('applicationUpdated', updatedApplication)
|
||||
})
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { getUserApplications, type GetUserApplicationsQuery, type UserApplication } from '@/services/api/userApplicationService'
|
||||
import { getUserApplications, type GetUserApplicationsQuery, type UserApplication } from '@/services/api-schema'
|
||||
import UserApplicationComponent from './UserApplication.vue'
|
||||
import { ref } from 'vue'
|
||||
import { onMounted } from 'vue'
|
||||
|
||||
@@ -38,7 +38,7 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { listStaffPms, type StaffPmOverview } from '@/services/api/staffPmService'
|
||||
import { listStaffPMs, type StaffPmOverview } from '@/services/api-schema'
|
||||
import { timeAgo } from '@/services/helpers'
|
||||
import { useNotificationsStore } from '@/stores/notifications'
|
||||
import { useUserStore } from '@/stores/user'
|
||||
@@ -60,7 +60,7 @@ const isPMRead = (p: StaffPmOverview) => {
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
listStaffPms()
|
||||
listStaffPMs()
|
||||
.then((data) => (staffPMs.value = data))
|
||||
.finally(() => (loading.value = false))
|
||||
})
|
||||
|
||||
@@ -202,15 +202,6 @@ import Button from 'primevue/button'
|
||||
import DatePicker from 'primevue/datepicker'
|
||||
import Message from 'primevue/message'
|
||||
import { InputNumber } from 'primevue'
|
||||
import {
|
||||
createTitleGroup,
|
||||
editTitleGroup,
|
||||
type ContentType,
|
||||
type EditedTitleGroup,
|
||||
type TitleGroup,
|
||||
type TitleGroupCategory,
|
||||
type UserCreatedTitleGroup,
|
||||
} from '@/services/api/titleGroupService'
|
||||
import { useI18n } from 'vue-i18n'
|
||||
import { getSelectableContentTypes, getLanguages, getPlatforms, isValidUrl } from '@/services/helpers'
|
||||
import { useTitleGroupStore } from '@/stores/titleGroup'
|
||||
@@ -221,8 +212,18 @@ import { nextTick } from 'vue'
|
||||
import _ from 'lodash'
|
||||
import { showToast } from '@/main'
|
||||
import type { UserCreatedTitleGroupForm } from './CreateOrSelectTitleGroup.vue'
|
||||
import type { AffiliatedArtistHierarchy, UserCreatedAffiliatedArtist } from '@/services/api/artistService'
|
||||
import TitleGroupTagsInput from '../TitleGroupTagsInput.vue'
|
||||
import {
|
||||
createTitleGroup,
|
||||
editTitleGroup,
|
||||
type AffiliatedArtistHierarchy,
|
||||
type ContentType,
|
||||
type EditedTitleGroup,
|
||||
type TitleGroup,
|
||||
type TitleGroupCategory,
|
||||
type UserCreatedAffiliatedArtist,
|
||||
type UserCreatedTitleGroup,
|
||||
} from '@/services/api-schema'
|
||||
|
||||
const props = defineProps<{
|
||||
initialTitleGroup?: EditedTitleGroup | UserCreatedTitleGroupForm
|
||||
|
||||
@@ -67,7 +67,6 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import type { UserCreatedEditionGroup } from '@/services/api/editionGroupService'
|
||||
import { ref } from 'vue'
|
||||
import { useI18n } from 'vue-i18n'
|
||||
import CreateOrEditTitleGroup from './CreateOrEditTitleGroup.vue'
|
||||
@@ -77,10 +76,18 @@ import ExternalDBSearchBar from './ExternalDBSearchBar.vue'
|
||||
import { Select, FloatLabel, Dialog } from 'primevue'
|
||||
import { useTitleGroupStore } from '@/stores/titleGroup'
|
||||
import { getSelectableContentTypes } from '@/services/helpers'
|
||||
import type { ExternalDBData } from '@/services/api/externalDatabasesService'
|
||||
import type { ContentType, Language, TitleGroup, TitleGroupLite, UserCreatedTitleGroup } from '@/services/api/titleGroupService'
|
||||
import { nextTick } from 'vue'
|
||||
import type { AffiliatedArtistHierarchy, UserCreatedAffiliatedArtist } from '@/services/api/artistService'
|
||||
import type {
|
||||
AffiliatedArtistHierarchy,
|
||||
ContentType,
|
||||
ExternalDBData,
|
||||
Language,
|
||||
TitleGroup,
|
||||
TitleGroupLite,
|
||||
UserCreatedAffiliatedArtist,
|
||||
UserCreatedEditionGroup,
|
||||
UserCreatedTitleGroup,
|
||||
} from '@/services/api-schema'
|
||||
|
||||
const { t } = useI18n()
|
||||
const titleGroupStore = useTitleGroupStore()
|
||||
|
||||
@@ -27,7 +27,12 @@ import Tab from 'primevue/tab'
|
||||
import TabPanels from 'primevue/tabpanels'
|
||||
import TabPanel from 'primevue/tabpanel'
|
||||
import { computed } from 'vue'
|
||||
import type { EmbeddedLinks } from '@/services/api/titleGroupService'
|
||||
|
||||
type EmbeddedLinks = {
|
||||
[key: string]: {
|
||||
[key: string]: string
|
||||
}
|
||||
}
|
||||
|
||||
const props = defineProps<{
|
||||
links: EmbeddedLinks
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
</FloatLabel>
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
import { getExternalDatabaseData, type ExternalDBData } from '@/services/api/externalDatabasesService'
|
||||
import { getComicVineData, getIsbnData, getMusicbranzData, getTMDBData, type ExternalDBData } from '@/services/api-schema'
|
||||
import { FloatLabel, IconField, InputIcon, InputText } from 'primevue'
|
||||
import { ref } from 'vue'
|
||||
|
||||
@@ -31,12 +31,37 @@ const props = defineProps<{
|
||||
const externalDBId = ref('')
|
||||
const loading = ref(false)
|
||||
|
||||
const getExternalDBData = (item_id: string | number) => {
|
||||
const getExternalDBData = async (item_id: string | number) => {
|
||||
loading.value = true
|
||||
getExternalDatabaseData(item_id, props.database)
|
||||
|
||||
let request: Promise<ExternalDBData>
|
||||
|
||||
switch (props.database) {
|
||||
case 'isbn': {
|
||||
request = getIsbnData(item_id.toString())
|
||||
break
|
||||
}
|
||||
case 'comic_vine': {
|
||||
request = getComicVineData(item_id.toString())
|
||||
break
|
||||
}
|
||||
case 'musicbrainz': {
|
||||
request = getMusicbranzData(item_id.toString())
|
||||
break
|
||||
}
|
||||
case 'tmdb': {
|
||||
request = getTMDBData(item_id.toString())
|
||||
break
|
||||
}
|
||||
default:
|
||||
loading.value = false
|
||||
throw 'database not supported'
|
||||
}
|
||||
|
||||
return request
|
||||
.then((data) => {
|
||||
// data.title_group.original_release_date = new Date(data.title_group.original_release_date)
|
||||
emit('dataFound', data)
|
||||
return data
|
||||
})
|
||||
.finally(() => {
|
||||
loading.value = false
|
||||
|
||||
@@ -26,12 +26,12 @@ import { useI18n } from 'vue-i18n'
|
||||
import { ref } from 'vue'
|
||||
import GeneralComment from '../community/GeneralComment.vue'
|
||||
import { Button } from 'primevue'
|
||||
import { postTitleGroupComment, type TitleGroupCommentHierarchy, type UserCreatedTitleGroupComment } from '@/services/api/commentService'
|
||||
import BBCodeEditor from '../community/BBCodeEditor.vue'
|
||||
import { Form, type FormResolverOptions, type FormSubmitEvent } from '@primevue/forms'
|
||||
import Message from 'primevue/message'
|
||||
import { useUserStore } from '@/stores/user'
|
||||
import { useRoute } from 'vue-router'
|
||||
import { createTitleGroupComment, type TitleGroupCommentHierarchy, type UserCreatedTitleGroupComment } from '@/services/api-schema'
|
||||
|
||||
defineProps<{
|
||||
comments: TitleGroupCommentHierarchy[]
|
||||
@@ -80,7 +80,7 @@ const sendComment = async () => {
|
||||
sending_comment.value = true
|
||||
new_comment.value.title_group_id = parseInt(route.params.id as string)
|
||||
const createdComment: TitleGroupCommentHierarchy = {
|
||||
...(await postTitleGroupComment(new_comment.value)),
|
||||
...(await createTitleGroupComment(new_comment.value)),
|
||||
created_by: useUserStore(),
|
||||
}
|
||||
new_comment.value.content = ''
|
||||
|
||||
@@ -65,11 +65,9 @@ import ContentContainer from '@/components/ContentContainer.vue'
|
||||
import { Galleria } from 'primevue'
|
||||
import AffiliatedArtist from '@/components/artist/AffiliatedArtist.vue'
|
||||
import ExternalLink from '@/components/ExternalLink.vue'
|
||||
import type { TitleGroup } from '@/services/api/titleGroupService'
|
||||
import { useI18n } from 'vue-i18n'
|
||||
import type { SeriesLite } from '@/services/api/seriesService'
|
||||
import type { AffiliatedArtistHierarchy } from '@/services/api/artistService'
|
||||
import ImagePreview from '../ImagePreview.vue'
|
||||
import type { AffiliatedArtistHierarchy, SeriesLite, TitleGroup } from '@/services/api-schema'
|
||||
|
||||
const { t } = useI18n()
|
||||
|
||||
|
||||
@@ -15,8 +15,7 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import type { TitleGroupHierarchyLite } from '@/services/api/artistService'
|
||||
import type { TitleGroupLite } from '@/services/api/titleGroupService'
|
||||
import type { TitleGroupHierarchyLite, TitleGroupLite } from '@/services/api-schema'
|
||||
import ContentContainer from '../ContentContainer.vue'
|
||||
import TitleGroupPreviewCoverOnly from './TitleGroupPreviewCoverOnly.vue'
|
||||
import TitleGroupPreviewTable from './TitleGroupPreviewTable.vue'
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
</div>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import type { TitleGroupLite } from '@/services/api/titleGroupService'
|
||||
import type { TitleGroupLite } from '@/services/api-schema'
|
||||
|
||||
defineProps<{
|
||||
titleGroup: TitleGroupLite
|
||||
|
||||
@@ -18,8 +18,8 @@
|
||||
<script setup lang="ts">
|
||||
import TitleGroupTable from './TitleGroupTable.vue'
|
||||
import ContentContainer from '../ContentContainer.vue'
|
||||
import type { TitleGroupHierarchyLite } from '@/services/api/artistService'
|
||||
import ImagePreview from '../ImagePreview.vue'
|
||||
import type { TitleGroupHierarchyLite } from '@/services/api-schema'
|
||||
|
||||
defineProps<{
|
||||
title_group: TitleGroupHierarchyLite
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
</ContentContainer>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import type { PublicRating } from '@/services/api/titleGroupService'
|
||||
import type { PublicRating } from '@/services/api-schema'
|
||||
import ContentContainer from '../ContentContainer.vue'
|
||||
import { useI18n } from 'vue-i18n'
|
||||
|
||||
|
||||
@@ -21,9 +21,9 @@
|
||||
<script lang="ts" setup>
|
||||
import { ref, watch } from 'vue'
|
||||
import { AutoComplete, type AutoCompleteOptionSelectEvent } from 'primevue'
|
||||
import { searchTitleGroupLite, type ContentType, type TitleGroupLite } from '@/services/api/titleGroupService'
|
||||
import TitleGroupSlimHeader from './TitleGroupSlimHeader.vue'
|
||||
import { useI18n } from 'vue-i18n'
|
||||
import { searchTitleGroupInfo, type ContentType, type TitleGroupLite } from '@/services/api-schema'
|
||||
|
||||
const props = defineProps<{
|
||||
placeholder: string
|
||||
@@ -75,7 +75,7 @@ const onInput = () => {
|
||||
|
||||
const search = () => {
|
||||
if (name.value !== '') {
|
||||
searchTitleGroupLite(name.value, props.contentType).then((titleGroups) => {
|
||||
searchTitleGroupInfo({ name: name.value, content_type: props.contentType }).then((titleGroups) => {
|
||||
foundTitleGroups.value = titleGroups
|
||||
if (props.createOption) {
|
||||
foundTitleGroups.value?.push(t('general.create_new_one'))
|
||||
|
||||
@@ -67,15 +67,20 @@ import AffiliatedArtist from '@/components/artist/AffiliatedArtist.vue'
|
||||
import ExternalLink from '@/components/ExternalLink.vue'
|
||||
import MasterGroupLink from '@/components/MasterGroupLink.vue'
|
||||
import ContentContainer from '../ContentContainer.vue'
|
||||
import type { TitleGroup, TitleGroupLite } from '@/services/api/titleGroupService'
|
||||
import { useI18n } from 'vue-i18n'
|
||||
import AffiliatedEntity from '../artist/AffiliatedEntity.vue'
|
||||
import type { SeriesLite } from '@/services/api/seriesService'
|
||||
import type { AffiliatedArtistHierarchy } from '@/services/api/artistService'
|
||||
import type { AffiliatedEntityHierarchy } from '@/services/api/entityService'
|
||||
import ImagePreview from '../ImagePreview.vue'
|
||||
import TitleGroupTagSearchBar from './TitleGroupTagSearchBar.vue'
|
||||
import { applyTitleGroupTag, removeTitleGroupTag, type TitleGroupTagLite } from '@/services/api/titleGroupTagService'
|
||||
import {
|
||||
applyTagToTitleGroup,
|
||||
removeTagFromTitleGroup,
|
||||
type AffiliatedArtistHierarchy,
|
||||
type AffiliatedEntityHierarchy,
|
||||
type SeriesLite,
|
||||
type TitleGroup,
|
||||
type TitleGroupLite,
|
||||
type TitleGroupTagLite,
|
||||
} from '@/services/api-schema'
|
||||
|
||||
const { t } = useI18n()
|
||||
|
||||
@@ -95,13 +100,13 @@ const props = defineProps<{
|
||||
}>()
|
||||
|
||||
const applyTag = async (tag: TitleGroupTagLite) => {
|
||||
applyTitleGroupTag({ tag_id: tag.id, title_group_id: props.title_group.id }).then(() => {
|
||||
applyTagToTitleGroup({ tag_id: tag.id, title_group_id: props.title_group.id }).then(() => {
|
||||
emit('tagApplied', tag.name)
|
||||
})
|
||||
}
|
||||
|
||||
const removeTag = async (tag_name: string) => {
|
||||
removeTitleGroupTag({ tag_name, title_group_id: props.title_group.id }).then(() => {
|
||||
removeTagFromTitleGroup({ tag_name, title_group_id: props.title_group.id }).then(() => {
|
||||
emit('tagRemoved', tag_name)
|
||||
})
|
||||
}
|
||||
|
||||
@@ -18,8 +18,7 @@
|
||||
</div>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import type { SeriesLite } from '@/services/api/seriesService'
|
||||
import type { TitleGroup, TitleGroupLite } from '@/services/api/titleGroupService'
|
||||
import type { SeriesLite, TitleGroup, TitleGroupLite } from '@/services/api-schema'
|
||||
|
||||
defineProps<{
|
||||
titleGroup: TitleGroup | TitleGroupLite
|
||||
|
||||
@@ -174,10 +174,9 @@ import AccordionContent from 'primevue/accordioncontent'
|
||||
import ReportTorrentDialog from '../torrent/ReportTorrentDialog.vue'
|
||||
import DeleteTorrentDialog from '../torrent/DeleteTorrentDialog.vue'
|
||||
import Dialog from 'primevue/dialog'
|
||||
import { downloadTorrent, type EditedTorrent, type TorrentHierarchyLite, type TorrentReport } from '@/services/api/torrentService'
|
||||
import { downloadTorrent } from '@/services/api/torrentService'
|
||||
import { useRoute } from 'vue-router'
|
||||
import { bytesToReadable, getEditionGroupSlug, timeAgo } from '@/services/helpers'
|
||||
import type { TitleGroupHierarchyLite } from '@/services/api/artistService'
|
||||
import { useI18n } from 'vue-i18n'
|
||||
import { RouterLink } from 'vue-router'
|
||||
import CreateOrEditTorrent from '../torrent/CreateOrEditTorrent.vue'
|
||||
@@ -185,8 +184,16 @@ import { useUserStore } from '@/stores/user'
|
||||
import { useEditionGroupStore } from '@/stores/editionGroup'
|
||||
import ImagePreview from '../ImagePreview.vue'
|
||||
import MediaInfoPreview from '@/components/mediainfo/MediaInfoPreview.vue'
|
||||
import type { TitleGroup } from '@/services/api/titleGroupService'
|
||||
import type { EditionGroupHierarchy, EditionGroupHierarchyLite, EditionGroupInfoLite } from '@/services/api/editionGroupService'
|
||||
import type {
|
||||
EditedTorrent,
|
||||
EditionGroupHierarchy,
|
||||
EditionGroupHierarchyLite,
|
||||
EditionGroupInfoLite,
|
||||
TitleGroup,
|
||||
TitleGroupHierarchyLite,
|
||||
TorrentHierarchyLite,
|
||||
TorrentReport,
|
||||
} from '@/services/api-schema'
|
||||
|
||||
interface Props {
|
||||
title_group: TitleGroup | TitleGroupHierarchyLite
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { searchTitleGroupTagsLite, createTitleGroupTag, type TitleGroupTagLite } from '@/services/api/titleGroupTagService'
|
||||
import { createTitleGroupTag, searchTitleGroupTags, type TitleGroupTagLite } from '@/services/api-schema'
|
||||
import { AutoComplete } from 'primevue'
|
||||
import { ref } from 'vue'
|
||||
import { useI18n } from 'vue-i18n'
|
||||
@@ -46,7 +46,7 @@ const name = ref('')
|
||||
const foundTags = ref<TitleGroupTagLite[]>([])
|
||||
|
||||
const searchTags = async () => {
|
||||
await searchTitleGroupTagsLite({ name: name.value, page: 1, page_size: 10 }).then((tags) => {
|
||||
await searchTitleGroupTags({ name: name.value, page: 1, page_size: 10 }).then((tags) => {
|
||||
foundTags.value = tags.results.filter((tag) => !props.hideTags.includes(tag.name))
|
||||
// only show the option to create a new tag if doesn't already exist
|
||||
// and if none of the synonyms is already it
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { deleteTitleGroupTag, type EditedTitleGroupTag } from '@/services/api/titleGroupTagService'
|
||||
import { deleteTitleGroupTag, type EditedTitleGroupTag } from '@/services/api-schema'
|
||||
import Button from 'primevue/button'
|
||||
import { ref } from 'vue'
|
||||
import { useI18n } from 'vue-i18n'
|
||||
@@ -36,7 +36,7 @@ const emit = defineEmits<{
|
||||
|
||||
const sendDeletion = () => {
|
||||
loading.value = true
|
||||
deleteTitleGroupTag(props.tag.id).then(() => {
|
||||
deleteTitleGroupTag({ id: props.tag.id }).then(() => {
|
||||
loading.value = false
|
||||
emit('deleted')
|
||||
})
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { editTitleGroupTag, type EditedTitleGroupTag } from '@/services/api/titleGroupTagService'
|
||||
import { editTitleGroupTag, type EditedTitleGroupTag } from '@/services/api-schema'
|
||||
import { FloatLabel, InputText, Chip } from 'primevue'
|
||||
import Button from 'primevue/button'
|
||||
import { ref, onMounted } from 'vue'
|
||||
|
||||
@@ -308,7 +308,7 @@ import {
|
||||
isAttributeUsed,
|
||||
} from '@/services/helpers'
|
||||
import { useEditionGroupStore } from '@/stores/editionGroup'
|
||||
import { uploadTorrent, editTorrent, type Torrent, type UploadedTorrent, type EditedTorrent, type Extras } from '@/services/api/torrentService'
|
||||
import { uploadTorrent } from '@/services/api/torrentService'
|
||||
import { useTitleGroupStore } from '@/stores/titleGroup'
|
||||
import { useI18n } from 'vue-i18n'
|
||||
import { nextTick } from 'vue'
|
||||
@@ -316,6 +316,7 @@ import type { VNodeRef } from 'vue'
|
||||
import _ from 'lodash'
|
||||
import { showToast } from '@/main'
|
||||
import { Chip } from 'primevue'
|
||||
import { editTorrent, type EditedTorrent, type Extras, type Torrent, type UploadedTorrent } from '@/services/api-schema'
|
||||
|
||||
const formRef = ref<VNodeRef | null>(null)
|
||||
const torrentFile = ref({ files: [] as unknown[] })
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { deleteTorrent, type TorrentToDelete } from '@/services/api/torrentService'
|
||||
import { deleteTorrent, type TorrentToDelete } from '@/services/api-schema'
|
||||
import { Textarea, FloatLabel } from 'primevue'
|
||||
import Button from 'primevue/button'
|
||||
import { ref } from 'vue'
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import type { TitleGroupLite } from '@/services/api/titleGroupService'
|
||||
import type { TitleGroupLite } from '@/services/api-schema'
|
||||
import ContentContainer from '../ContentContainer.vue'
|
||||
import TitleGroupPreviewCoverOnly from '../title_group/TitleGroupPreviewCoverOnly.vue'
|
||||
import { useI18n } from 'vue-i18n'
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { reportTorrent, type TorrentReport, type UserCreatedTorrentReport } from '@/services/api/torrentService'
|
||||
import { createTorrentReport, type TorrentReport, type UserCreatedTorrentReport } from '@/services/api-schema'
|
||||
import { Textarea, FloatLabel } from 'primevue'
|
||||
import Button from 'primevue/button'
|
||||
import { ref } from 'vue'
|
||||
@@ -31,7 +31,7 @@ const emit = defineEmits<{
|
||||
const sendReport = () => {
|
||||
loading.value = true
|
||||
report.value.reported_torrent_id = props.torrentId
|
||||
reportTorrent(report.value)
|
||||
createTorrentReport(report.value)
|
||||
.then((data: TorrentReport) => {
|
||||
emit('reported', data)
|
||||
})
|
||||
|
||||
@@ -84,10 +84,10 @@ import InputText from 'primevue/inputtext'
|
||||
import FloatLabel from 'primevue/floatlabel'
|
||||
import Button from 'primevue/button'
|
||||
import { Dropdown, InputNumber } from 'primevue'
|
||||
import type { TorrentSearch } from '@/services/api/torrentService'
|
||||
import { onMounted } from 'vue'
|
||||
import { useRouter } from 'vue-router'
|
||||
import { watch } from 'vue'
|
||||
import type { TorrentSearch } from '@/services/api-schema'
|
||||
|
||||
const { t } = useI18n()
|
||||
const router = useRouter()
|
||||
|
||||
@@ -28,11 +28,9 @@
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import type { TorrentHierarchyLite } from '@/services/api/torrentService'
|
||||
import { useI18n } from 'vue-i18n'
|
||||
import { computed } from 'vue'
|
||||
import type { ContentType } from '@/services/api/titleGroupService'
|
||||
import type { EditionGroupInfoLite } from '@/services/api/editionGroupService'
|
||||
import type { ContentType, EditionGroupInfoLite, TorrentHierarchyLite } from '@/services/api-schema'
|
||||
|
||||
const { t } = useI18n()
|
||||
|
||||
|
||||
@@ -290,10 +290,9 @@ import { nextTick } from 'vue'
|
||||
import type { VNodeRef } from 'vue'
|
||||
import _ from 'lodash'
|
||||
import { showToast } from '@/main'
|
||||
import type { UserCreatedTorrentRequest, TorrentRequest } from '@/services/api/torrentRequestService'
|
||||
import { createTorrentRequest } from '@/services/api/torrentRequestService'
|
||||
import TorrentRequestVoteInputs from './TorrentRequestVoteInputs.vue'
|
||||
import { useUserStore } from '@/stores/user'
|
||||
import { createTorrentRequest, type TorrentRequest, type UserCreatedTorrentRequest } from '@/services/api-schema'
|
||||
|
||||
const formRef = ref<VNodeRef | null>(null)
|
||||
const torrentRequestForm = ref<UserCreatedTorrentRequest>({
|
||||
|
||||
@@ -32,22 +32,22 @@
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import type { TorrentRequest } from '@/services/api/torrentRequestService'
|
||||
import ContentContainer from '../ContentContainer.vue'
|
||||
import { useI18n } from 'vue-i18n'
|
||||
import { ref } from 'vue'
|
||||
import {
|
||||
newTorrentRequestVote,
|
||||
type TorrentRequestVote,
|
||||
type TorrentRequestVoteHierarchy,
|
||||
type UserCreatedTorrentRequestVote,
|
||||
} from '@/services/api/torrentRequestVoteService'
|
||||
import { bytesToReadable, isAttributeUsed } from '@/services/helpers'
|
||||
import { useUserStore } from '@/stores/user'
|
||||
import { showToast } from '@/main'
|
||||
import type { ContentType } from '@/services/api/titleGroupService'
|
||||
import { computed } from 'vue'
|
||||
import TorrentRequestVoteInputs from './TorrentRequestVoteInputs.vue'
|
||||
import {
|
||||
createTorrentRequestVote,
|
||||
type ContentType,
|
||||
type TorrentRequest,
|
||||
type TorrentRequestVote,
|
||||
type TorrentRequestVoteHierarchy,
|
||||
type UserCreatedTorrentRequestVote,
|
||||
} from '@/services/api-schema'
|
||||
|
||||
const { t } = useI18n()
|
||||
|
||||
@@ -82,7 +82,7 @@ const newVoteLoading = ref(false)
|
||||
const vote = async (newVote: UserCreatedTorrentRequestVote) => {
|
||||
newVoteLoading.value = true
|
||||
|
||||
newTorrentRequestVote({ ...newVote, torrent_request_id: props.torrentRequest.id })
|
||||
createTorrentRequestVote({ ...newVote, torrent_request_id: props.torrentRequest.id })
|
||||
.then((castedVote) => {
|
||||
emit('voted', { ...castedVote, created_by: userStore })
|
||||
userStore.uploaded -= castedVote.bounty_upload
|
||||
|
||||
@@ -27,8 +27,8 @@ import ContentContainer from '../ContentContainer.vue'
|
||||
import InputText from 'primevue/inputtext'
|
||||
import FloatLabel from 'primevue/floatlabel'
|
||||
import Button from 'primevue/button'
|
||||
import type { SearchTorrentRequestsQuery } from '@/services/api/torrentRequestService'
|
||||
import { onMounted } from 'vue'
|
||||
import type { SearchTorrentRequestsQuery } from '@/services/api-schema'
|
||||
|
||||
const { t } = useI18n()
|
||||
|
||||
|
||||
@@ -17,11 +17,10 @@
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import type { TorrentRequest } from '@/services/api/torrentRequestService'
|
||||
import type { ContentType } from '@/services/api/titleGroupService'
|
||||
import { useI18n } from 'vue-i18n'
|
||||
import { computed } from 'vue'
|
||||
import { isAttributeUsed } from '@/services/helpers'
|
||||
import type { ContentType, TorrentRequest } from '@/services/api-schema'
|
||||
|
||||
const { t } = useI18n()
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
</div>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import type { UserCreatedTorrentRequestVote } from '@/services/api/torrentRequestVoteService'
|
||||
import type { UserCreatedTorrentRequestVote } from '@/services/api-schema'
|
||||
import { FloatLabel } from 'primevue'
|
||||
import { InputNumber, Select, Button } from 'primevue'
|
||||
import { ref } from 'vue'
|
||||
|
||||
@@ -25,10 +25,10 @@
|
||||
|
||||
<script setup lang="ts">
|
||||
import { Column, DataTable } from 'primevue'
|
||||
import { type TorrentRequestVoteHierarchy } from '@/services/api/torrentRequestVoteService'
|
||||
import UsernameEnriched from '../user/UsernameEnriched.vue'
|
||||
import { bytesToReadable, timeAgo } from '@/services/helpers'
|
||||
import { useI18n } from 'vue-i18n'
|
||||
import type { TorrentRequestVoteHierarchy } from '@/services/api-schema'
|
||||
|
||||
const { t } = useI18n()
|
||||
|
||||
|
||||
@@ -30,13 +30,12 @@
|
||||
|
||||
<script setup lang="ts">
|
||||
import { Column, DataTable } from 'primevue'
|
||||
import type { TorrentRequestHierarchyLite, TorrentRequestWithTitleGroupLite } from '@/services/api/torrentRequestService'
|
||||
import TorrentRequestSlug from './TorrentRequestSlug.vue'
|
||||
import TitleGroupSlimHeader from '../title_group/TitleGroupSlimHeader.vue'
|
||||
import { RouterLink } from 'vue-router'
|
||||
import type { ContentType } from '@/services/api/titleGroupService'
|
||||
import { bytesToReadable } from '@/services/helpers'
|
||||
import { useI18n } from 'vue-i18n'
|
||||
import type { ContentType, TorrentRequestHierarchyLite, TorrentRequestWithTitleGroupLite } from '@/services/api-schema'
|
||||
|
||||
defineProps<{
|
||||
torrentRequests: TorrentRequestHierarchyLite[] | TorrentRequestWithTitleGroupLite[]
|
||||
|
||||
@@ -20,7 +20,6 @@
|
||||
|
||||
<script setup lang="ts">
|
||||
import { showToast } from '@/main'
|
||||
import { type EditedUser, editUser } from '@/services/api/userService'
|
||||
import { FloatLabel, InputText } from 'primevue'
|
||||
import { Form } from '@primevue/forms'
|
||||
import BBCodeEditor from '../community/BBCodeEditor.vue'
|
||||
@@ -30,6 +29,7 @@ import { useI18n } from 'vue-i18n'
|
||||
import { onMounted } from 'vue'
|
||||
import type { VNodeRef } from 'vue'
|
||||
import { nextTick } from 'vue'
|
||||
import { editUser, type EditedUser } from '@/services/api-schema'
|
||||
|
||||
const { t } = useI18n()
|
||||
const formRef = ref<VNodeRef | null>(null)
|
||||
|
||||
@@ -29,9 +29,9 @@
|
||||
<script setup lang="ts">
|
||||
import DataTable from 'primevue/datatable'
|
||||
import Column from 'primevue/column'
|
||||
import type { Peer } from '@/services/api/userService'
|
||||
import { bytesToReadable, timeAgo } from '@/services/helpers'
|
||||
import { useI18n } from 'vue-i18n'
|
||||
import type { Peer } from '@/services/api-schema'
|
||||
|
||||
const { t } = useI18n()
|
||||
|
||||
|
||||
@@ -23,13 +23,13 @@
|
||||
</div>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { sendInvitation, type SentInvitation, type Invitation } from '@/services/api/userService'
|
||||
import { Textarea } from 'primevue'
|
||||
import { FloatLabel, Button } from 'primevue'
|
||||
import { onMounted } from 'vue'
|
||||
import { ref } from 'vue'
|
||||
import { InputText } from 'primevue'
|
||||
import { useI18n } from 'vue-i18n'
|
||||
import { createInvitation, type Invitation, type SentInvitation } from '@/services/api-schema'
|
||||
|
||||
const { t } = useI18n()
|
||||
|
||||
@@ -55,7 +55,7 @@ const createdInvitation = ref<Invitation>()
|
||||
|
||||
const sendNewInvitation = () => {
|
||||
loading.value = true
|
||||
sendInvitation(invitation.value)
|
||||
createInvitation(invitation.value)
|
||||
.then((data) => {
|
||||
createdInvitation.value = data
|
||||
emit('invitationSent')
|
||||
|
||||
@@ -46,11 +46,11 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import type { PublicUser, User } from '@/services/api/userService'
|
||||
import ContentContainer from '../ContentContainer.vue'
|
||||
import { useI18n } from 'vue-i18n'
|
||||
import { bytesToReadable, timeAgo, formatDate } from '@/services/helpers'
|
||||
import ImagePreview from '../ImagePreview.vue'
|
||||
import type { PublicUser, User } from '@/services/api-schema'
|
||||
|
||||
const { t } = useI18n()
|
||||
|
||||
|
||||
@@ -9,9 +9,9 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import type { UserLite } from '@/services/api/userService'
|
||||
import { RouterLink } from 'vue-router'
|
||||
import { useI18n } from 'vue-i18n'
|
||||
import type { UserLite } from '@/services/api-schema'
|
||||
|
||||
const { t } = useI18n()
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
|
||||
<script setup lang="ts">
|
||||
import { showToast } from '@/main'
|
||||
import { warnUser, type UserCreatedUserWarning, type UserWarning } from '@/services/api/userService'
|
||||
import { warnUser, type UserCreatedUserWarning, type UserWarning } from '@/services/api-schema'
|
||||
import { Textarea, FloatLabel, Checkbox } from 'primevue'
|
||||
import Button from 'primevue/button'
|
||||
import { ref } from 'vue'
|
||||
|
||||
4
frontend/src/services/api-schema/.gitignore
vendored
Normal file
4
frontend/src/services/api-schema/.gitignore
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
wwwroot/*.js
|
||||
node_modules
|
||||
typings
|
||||
dist
|
||||
1
frontend/src/services/api-schema/.npmignore
Normal file
1
frontend/src/services/api-schema/.npmignore
Normal file
@@ -0,0 +1 @@
|
||||
# empty npmignore to ensure all required files (e.g., in the dist folder) are published by npm
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user