Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
N
Neos
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
1
Issues
1
List
Boards
Labels
Service Desk
Milestones
Merge Requests
2
Merge Requests
2
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
MyCard
Neos
Commits
f86cb502
Commit
f86cb502
authored
Jun 15, 2024
by
Chunchi Che
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix small
parent
18ab60c3
Pipeline
#27779
passed with stages
in 6 minutes and 50 seconds
Changes
5
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
19 additions
and
7 deletions
+19
-7
src/api/mdproDeck/pull.ts
src/api/mdproDeck/pull.ts
+2
-2
src/api/mdproDeck/schema.ts
src/api/mdproDeck/schema.ts
+11
-0
src/stores/accountStore.ts
src/stores/accountStore.ts
+1
-1
src/ui/BuildDeck/DeckDatabase/DeckResults/index.tsx
src/ui/BuildDeck/DeckDatabase/DeckResults/index.tsx
+4
-4
src/ui/BuildDeck/DeckSelect/index.tsx
src/ui/BuildDeck/DeckSelect/index.tsx
+1
-0
No files found.
src/api/mdproDeck/pull.ts
View file @
f86cb502
import
{
useConfig
}
from
"
@/config
"
;
import
{
useConfig
}
from
"
@/config
"
;
import
{
MdproDeck
,
MdproResp
}
from
"
./schema
"
;
import
{
MdproDeck
Like
,
MdproResp
}
from
"
./schema
"
;
import
{
handleHttps
,
mdproHeaders
}
from
"
./util
"
;
import
{
handleHttps
,
mdproHeaders
}
from
"
./util
"
;
const
{
mdproServer
}
=
useConfig
();
const
{
mdproServer
}
=
useConfig
();
...
@@ -25,7 +25,7 @@ interface RespData {
...
@@ -25,7 +25,7 @@ interface RespData {
size
:
number
;
size
:
number
;
total
:
number
;
total
:
number
;
pages
:
number
;
pages
:
number
;
records
:
MdproDeck
[];
records
:
MdproDeck
Like
[];
}
}
export
async
function
pullDecks
(
export
async
function
pullDecks
(
...
...
src/api/mdproDeck/schema.ts
View file @
f86cb502
...
@@ -24,4 +24,15 @@ export interface MdproDeck {
...
@@ -24,4 +24,15 @@ export interface MdproDeck {
/* Content of the deck. */
/* Content of the deck. */
deckYdk
?:
string
;
deckYdk
?:
string
;
deckCase
:
number
;
deckCase
:
number
;
/* User ID of MyCard Account */
userId
:
number
;
}
export
interface
MdproDeckLike
{
deckId
:
string
;
deckContributor
:
string
;
deckName
:
string
;
deckLike
:
string
;
deckCase
:
number
;
lastDate
:
string
;
}
}
src/stores/accountStore.ts
View file @
f86cb502
...
@@ -3,7 +3,7 @@ import { proxy } from "valtio";
...
@@ -3,7 +3,7 @@ import { proxy } from "valtio";
import
{
type
NeosStore
}
from
"
./shared
"
;
import
{
type
NeosStore
}
from
"
./shared
"
;
export
interface
User
{
export
interface
User
{
id
:
string
;
id
:
number
;
username
:
string
;
username
:
string
;
name
:
string
;
name
:
string
;
email
:
string
;
email
:
string
;
...
...
src/ui/BuildDeck/DeckDatabase/DeckResults/index.tsx
View file @
f86cb502
...
@@ -4,7 +4,7 @@ import { type INTERNAL_Snapshot as Snapshot, proxy, useSnapshot } from "valtio";
...
@@ -4,7 +4,7 @@ import { type INTERNAL_Snapshot as Snapshot, proxy, useSnapshot } from "valtio";
import
YGOProDeck
from
"
ygopro-deck-encode
"
;
import
YGOProDeck
from
"
ygopro-deck-encode
"
;
import
{
mgetDeck
,
pullDecks
}
from
"
@/api
"
;
import
{
mgetDeck
,
pullDecks
}
from
"
@/api
"
;
import
{
MdproDeck
}
from
"
@/api/mdproDeck/schema
"
;
import
{
MdproDeck
Like
}
from
"
@/api/mdproDeck/schema
"
;
import
{
useConfig
}
from
"
@/config
"
;
import
{
useConfig
}
from
"
@/config
"
;
import
{
IconFont
}
from
"
@/ui/Shared
"
;
import
{
IconFont
}
from
"
@/ui/Shared
"
;
...
@@ -18,7 +18,7 @@ const { assetsPath } = useConfig();
...
@@ -18,7 +18,7 @@ const { assetsPath } = useConfig();
interface
Props
{
interface
Props
{
query
:
string
;
query
:
string
;
page
:
number
;
page
:
number
;
decks
:
MdproDeck
[];
decks
:
MdproDeck
Like
[];
total
:
number
;
total
:
number
;
}
}
...
@@ -102,7 +102,7 @@ export const DeckResults: React.FC = memo(() => {
...
@@ -102,7 +102,7 @@ export const DeckResults: React.FC = memo(() => {
);
);
});
});
const
MdproDeckBlock
:
React
.
FC
<
Snapshot
<
MdproDeck
>>
=
(
deck
)
=>
(
const
MdproDeckBlock
:
React
.
FC
<
Snapshot
<
MdproDeck
Like
>>
=
(
deck
)
=>
(
<
div
<
div
className=
{
styles
[
"
mdpro-deck
"
]
}
className=
{
styles
[
"
mdpro-deck
"
]
}
onClick=
{
async
()
=>
await
copyMdproDeckToEditing
(
deck
)
}
onClick=
{
async
()
=>
await
copyMdproDeckToEditing
(
deck
)
}
...
@@ -119,7 +119,7 @@ const MdproDeckBlock: React.FC<Snapshot<MdproDeck>> = (deck) => (
...
@@ -119,7 +119,7 @@ const MdproDeckBlock: React.FC<Snapshot<MdproDeck>> = (deck) => (
</
div
>
</
div
>
);
);
const
copyMdproDeckToEditing
=
async
(
mdproDeck
:
MdproDeck
)
=>
{
const
copyMdproDeckToEditing
=
async
(
mdproDeck
:
MdproDeck
Like
)
=>
{
// currently the content of the deck, which we named `Ydk`,
// currently the content of the deck, which we named `Ydk`,
// haven't been downloaded, so we need to fetch from server again by `mgetDeck`
// haven't been downloaded, so we need to fetch from server again by `mgetDeck`
// API.
// API.
...
...
src/ui/BuildDeck/DeckSelect/index.tsx
View file @
f86cb502
...
@@ -136,6 +136,7 @@ export const DeckSelect: React.FC<{
...
@@ -136,6 +136,7 @@ export const DeckSelect: React.FC<{
deckName
:
deck
.
deckName
,
deckName
:
deck
.
deckName
,
deckYdk
:
genYdkText
(
deck
),
deckYdk
:
genYdkText
(
deck
),
deckCase
:
DEFAULT_DECK_CASE
,
deckCase
:
DEFAULT_DECK_CASE
,
userId
:
user
.
id
,
};
};
const
resp
=
await
uploadDeck
(
mdproDeck
);
const
resp
=
await
uploadDeck
(
mdproDeck
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment