aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/client/sync
diff options
context:
space:
mode:
Diffstat (limited to 'src/client/sync')
-rw-r--r--src/client/sync/conflict.ts2
-rw-r--r--src/client/sync/pull.test.ts2
-rw-r--r--src/client/sync/pull.ts4
-rw-r--r--src/client/sync/push.test.ts4
-rw-r--r--src/client/sync/queue.test.ts2
5 files changed, 14 insertions, 0 deletions
diff --git a/src/client/sync/conflict.ts b/src/client/sync/conflict.ts
index 4e0e3ef..e4f1cbf 100644
--- a/src/client/sync/conflict.ts
+++ b/src/client/sync/conflict.ts
@@ -65,6 +65,8 @@ function serverCardToLocal(card: ServerCard): LocalCard {
return {
id: card.id,
deckId: card.deckId,
+ noteId: card.noteId ?? null,
+ isReversed: card.isReversed ?? null,
front: card.front,
back: card.back,
state: card.state as LocalCard["state"],
diff --git a/src/client/sync/pull.test.ts b/src/client/sync/pull.test.ts
index 23c64ef..84c22bd 100644
--- a/src/client/sync/pull.test.ts
+++ b/src/client/sync/pull.test.ts
@@ -107,6 +107,8 @@ describe("pullResultToLocalData", () => {
expect(result.cards[0]).toEqual({
id: "card-1",
deckId: "deck-1",
+ noteId: null,
+ isReversed: null,
front: "Question",
back: "Answer",
state: CardState.Review,
diff --git a/src/client/sync/pull.ts b/src/client/sync/pull.ts
index 333782c..fa0899b 100644
--- a/src/client/sync/pull.ts
+++ b/src/client/sync/pull.ts
@@ -28,6 +28,8 @@ export interface ServerDeck {
export interface ServerCard {
id: string;
deckId: string;
+ noteId?: string | null;
+ isReversed?: boolean | null;
front: string;
back: string;
state: number;
@@ -104,6 +106,8 @@ function serverCardToLocal(card: ServerCard): LocalCard {
return {
id: card.id,
deckId: card.deckId,
+ noteId: card.noteId ?? null,
+ isReversed: card.isReversed ?? null,
front: card.front,
back: card.back,
state: card.state as CardStateType,
diff --git a/src/client/sync/push.test.ts b/src/client/sync/push.test.ts
index 911a8d3..a3ff154 100644
--- a/src/client/sync/push.test.ts
+++ b/src/client/sync/push.test.ts
@@ -77,6 +77,8 @@ describe("pendingChangesToPushData", () => {
{
id: "card-1",
deckId: "deck-1",
+ noteId: null,
+ isReversed: null,
front: "Question",
back: "Answer",
state: CardState.Review,
@@ -128,6 +130,8 @@ describe("pendingChangesToPushData", () => {
{
id: "card-1",
deckId: "deck-1",
+ noteId: null,
+ isReversed: null,
front: "New Card",
back: "Answer",
state: CardState.New,
diff --git a/src/client/sync/queue.test.ts b/src/client/sync/queue.test.ts
index f6a3019..b62ece2 100644
--- a/src/client/sync/queue.test.ts
+++ b/src/client/sync/queue.test.ts
@@ -420,6 +420,8 @@ describe("SyncQueue", () => {
const serverCard = {
id: "server-card-1",
deckId: deck.id,
+ noteId: null,
+ isReversed: null,
front: "Server Question",
back: "Server Answer",
state: CardState.New,