mirror of
https://github.com/overleaf/overleaf.git
synced 2024-12-01 15:11:30 -05:00
More concise handling of optional migratedFromId
in test
This commit is contained in:
parent
709cb0887c
commit
8cb715014c
1 changed files with 13 additions and 22 deletions
|
@ -83,7 +83,10 @@ public class SnapshotAPIStateBuilder {
|
||||||
String projectName,
|
String projectName,
|
||||||
JsonObject jsonGetDoc
|
JsonObject jsonGetDoc
|
||||||
) {
|
) {
|
||||||
|
String migratedFromId = null;
|
||||||
if (jsonGetDoc.has("migratedFromId")) {
|
if (jsonGetDoc.has("migratedFromId")) {
|
||||||
|
migratedFromId = jsonGetDoc.get("migratedFromId").getAsString();
|
||||||
|
}
|
||||||
getDoc.put(
|
getDoc.put(
|
||||||
projectName,
|
projectName,
|
||||||
new GetDocResult(
|
new GetDocResult(
|
||||||
|
@ -92,21 +95,9 @@ public class SnapshotAPIStateBuilder {
|
||||||
jsonGetDoc.get("createdAt").getAsString(),
|
jsonGetDoc.get("createdAt").getAsString(),
|
||||||
jsonGetDoc.get("email").getAsString(),
|
jsonGetDoc.get("email").getAsString(),
|
||||||
jsonGetDoc.get("name").getAsString(),
|
jsonGetDoc.get("name").getAsString(),
|
||||||
jsonGetDoc.get("migratedFromId").getAsString()
|
migratedFromId
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
} else {
|
|
||||||
getDoc.put(
|
|
||||||
projectName,
|
|
||||||
new GetDocResult(
|
|
||||||
jsonGetDoc.get("error"),
|
|
||||||
jsonGetDoc.get("versionID").getAsInt(),
|
|
||||||
jsonGetDoc.get("createdAt").getAsString(),
|
|
||||||
jsonGetDoc.get("email").getAsString(),
|
|
||||||
jsonGetDoc.get("name").getAsString()
|
|
||||||
)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void addGetSavedVersForProject(
|
private void addGetSavedVersForProject(
|
||||||
|
|
Loading…
Reference in a new issue