Skip to content

Commit

Permalink
Remove unused MergeWords MergedBy and Time fields (#989)
Browse files Browse the repository at this point in the history
  • Loading branch information
johnthagen authored Feb 5, 2021
1 parent 68f6c5e commit 5f4387a
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 13 deletions.
1 change: 0 additions & 1 deletion Backend.Tests/Controllers/WordControllerTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,6 @@ public void MergeWords()
var parentChildMergeObject = new MergeWords
{
Parent = RandomWord(),
Time = Util.RandString(),
ChildrenWords = new List<MergeSourceWord>()
};

Expand Down
4 changes: 0 additions & 4 deletions Backend/Models/Word.cs
Original file line number Diff line number Diff line change
Expand Up @@ -404,15 +404,11 @@ public class MergeWords
{
public Word Parent { get; set; }
public List<MergeSourceWord> ChildrenWords { get; set; }
public string MergedBy { get; set; }
public string Time { get; set; }

public MergeWords()
{
Parent = new Word();
ChildrenWords = new List<MergeSourceWord>();
MergedBy = "";
Time = "";
}
}

Expand Down
5 changes: 2 additions & 3 deletions src/backend/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -99,14 +99,13 @@ export async function mergeWords(
SrcWordID: child.wordID,
SenseStates: child.senses,
}));
let merge = {
let mergeWords = {
Parent: parent,
ChildrenWords: childrenWords,
Time: Date.now().toString(),
};
let resp = await backendServer.put(
`projects/${LocalStorage.getProjectId()}/words`,
merge,
mergeWords,
{ headers: authHeader() }
);
return resp.data;
Expand Down
9 changes: 4 additions & 5 deletions src/types/word.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,9 @@ export interface MergeWord {
senses: State[];
}

export interface Merge {
export interface MergeWords {
parent: Word;
children: MergeWord[];
time: string;
}

//used in ExistingDataTable
Expand All @@ -73,12 +72,12 @@ export interface DomainWord {
}

export function hasSenses(word: Word): boolean {
let returnval =
return (
word.senses &&
word.senses.length > 0 &&
word.senses[0].glosses &&
word.senses[0].glosses.length > 0;
return returnval;
word.senses[0].glosses.length > 0
);
}

export function simpleWord(vern: string, gloss: string): Word {
Expand Down

0 comments on commit 5f4387a

Please sign in to comment.