Skip to content

Commit

Permalink
avniproject/avni-client#1256 | Rename initCountOfCards to countOfCard…
Browse files Browse the repository at this point in the history
…s in ReportCard
  • Loading branch information
himeshr committed Jan 23, 2024
1 parent 5ef8394 commit c533bbb
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
12 changes: 6 additions & 6 deletions src/ReportCard.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class ReportCard extends BaseEntity {
colour: "string",
voided: {type: "bool", default: false},
nested: {type: "bool", default: false, optional: true},
initCountOfCards: {type: "int", default: 1, optional: true}, //Used only by nested ReportCards
countOfCards: {type: "int", default: 1, optional: true}, //Used only by nested ReportCards
},
};

Expand Down Expand Up @@ -78,12 +78,12 @@ class ReportCard extends BaseEntity {
this.that.nested = x;
}

get initCountOfCards() {
return this.that.initCountOfCards;
get countOfCards() {
return this.that.countOfCards;
}

set initCountOfCards(x) {
this.that.initCountOfCards = x;
set countOfCards(x) {
this.that.countOfCards = x;
}

get iconName() {
Expand Down Expand Up @@ -117,7 +117,7 @@ class ReportCard extends BaseEntity {

static fromResource(resource, entityService) {
const reportCard = General.assignFields(resource, new ReportCard(),
["uuid", "name", "query", "description", "colour", "voided", "nested", "initCountOfCards"]);
["uuid", "name", "query", "description", "colour", "voided", "nested", "countOfCards"]);
reportCard.standardReportCardType = entityService.findByKey(
"uuid",
ResourceUtil.getUUIDFor(resource, "standardReportCardUUID"),
Expand Down
2 changes: 1 addition & 1 deletion src/Schema.js
Original file line number Diff line number Diff line change
Expand Up @@ -815,7 +815,7 @@ function createRealmConfig() {
if (oldDB.schemaVersion < 182) {
_.forEach(newDB.objects(ReportCard.schema.name), (rc) => {
rc.nested = false;
rc.initCountOfCards = 1;
rc.countOfCards = 1;
});
}
if (newDB.schemaVersion < 183) {
Expand Down

0 comments on commit c533bbb

Please sign in to comment.