It's impossible to be set on a type schema
This commit is contained in:
@@ -51,9 +51,9 @@ export const actions: Actions = {
|
||||
const serviceData: Jellyfin.JFService = {
|
||||
type: 'jellyfin',
|
||||
userId: authData.User.Id,
|
||||
username: userData.Name,
|
||||
// username: userData.Name,
|
||||
urlOrigin: serverUrl.toString(),
|
||||
serverName: systemData.ServerName,
|
||||
// serverName: systemData.ServerName,
|
||||
}
|
||||
const tokenData: Jellyfin.JFTokens = {
|
||||
accessToken: authData.AccessToken,
|
||||
@@ -89,9 +89,9 @@ export const actions: Actions = {
|
||||
const serviceData: YouTubeMusic.YTService = {
|
||||
type: 'youtube-music',
|
||||
userId: userChannel.id as string,
|
||||
username: userChannel.snippet?.title as string,
|
||||
// username: userChannel.snippet?.title as string,
|
||||
urlOrigin: 'https://www.googleapis.com/youtube/v3',
|
||||
profilePicture: userChannel.snippet?.thumbnails?.default?.url as string | undefined,
|
||||
// profilePicture: userChannel.snippet?.thumbnails?.default?.url as string | undefined,
|
||||
}
|
||||
|
||||
const newConnectionResponse = await fetch(`/api/users/${locals.user.id}/connections`, {
|
||||
@@ -105,9 +105,13 @@ export const actions: Actions = {
|
||||
const newConnection: YouTubeMusic.YTConnection = await newConnectionResponse.json()
|
||||
return { newConnection }
|
||||
},
|
||||
refreshConnection: async ({ request }) => {
|
||||
const formData = await request.formData()
|
||||
const connectionId = formData.get('connectionId')?.toString() as string
|
||||
},
|
||||
deleteConnection: async ({ request, fetch, locals }) => {
|
||||
const formData = await request.formData()
|
||||
const connectionId = formData.get('connectionId')
|
||||
const connectionId = formData.get('connectionId')?.toString() as string
|
||||
|
||||
const deleteConnectionResponse = await fetch(`/api/users/${locals.user.id}/connections`, {
|
||||
method: 'DELETE',
|
||||
|
||||
@@ -74,7 +74,10 @@
|
||||
}
|
||||
}
|
||||
|
||||
const deleteConnection: SubmitFunction = () => {
|
||||
const profileActions: SubmitFunction = ({ action, cancel }) => {
|
||||
console.log(action)
|
||||
cancel()
|
||||
|
||||
return ({ result }) => {
|
||||
if (result.type === 'failure') {
|
||||
return ($newestAlert = ['warning', result.data?.message])
|
||||
@@ -108,9 +111,9 @@
|
||||
</form>
|
||||
</div>
|
||||
</section>
|
||||
<div class="grid gap-8 grid-cols-3">
|
||||
<div id="connection-profile-grid" class="grid gap-8">
|
||||
{#each connections as connection}
|
||||
<ConnectionProfile {connection} submitFunction={deleteConnection} />
|
||||
<ConnectionProfile {connection} submitFunction={profileActions} />
|
||||
{/each}
|
||||
</div>
|
||||
{#if newConnectionModal !== null}
|
||||
@@ -122,4 +125,7 @@
|
||||
.add-connection-button {
|
||||
background-image: linear-gradient(to bottom, rgb(30, 30, 30), rgb(10, 10, 10));
|
||||
}
|
||||
#connection-profile-grid {
|
||||
grid-template-columns: repeat(auto-fit, minmax(24rem, 1fr));
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
{/if}
|
||||
</div>
|
||||
<div>
|
||||
<div>{connection.service.username}</div>
|
||||
<div>Username</div>
|
||||
<div class="text-sm text-neutral-500">
|
||||
{serviceData.displayName}
|
||||
{#if 'serverName' in connection.service}
|
||||
@@ -39,9 +39,9 @@
|
||||
<form
|
||||
use:enhance={submitFunction}
|
||||
method="post"
|
||||
class="absolute right-0 top-full flex flex-col items-center justify-center gap-3 rounded-md bg-neutral-900 p-2 text-xs"
|
||||
class="absolute right-0 top-full flex flex-col items-center justify-center gap-1 rounded-md bg-neutral-900 p-2 text-xs"
|
||||
>
|
||||
<button formaction="?/deleteConnection" class="py-2 px-3 whitespace-nowrap hover:bg-neutral-800 rounded-md" on:click={() => showModal = false}>
|
||||
<button formaction="?/deleteConnection" class="py-2 px-3 whitespace-nowrap hover:bg-neutral-800 rounded-md">
|
||||
<i class="fa-solid fa-link-slash mr-1" />
|
||||
Delete Connection
|
||||
</button>
|
||||
|
||||
Reference in New Issue
Block a user