Skip to content

Commit

Permalink
✏️ Change receivers.json to receiver.json
Browse files Browse the repository at this point in the history
  • Loading branch information
anthonypillot committed Dec 12, 2022
1 parent c72837b commit 383c716
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/services/data.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ export class DataService {
client: {
name: "client.json",
},
receivers: {
name: "receivers.json",
receiver: {
name: "receiver.json",
},
cache: {
name: "cache.json",
Expand Down Expand Up @@ -52,7 +52,7 @@ export class DataService {

public async getReceivers(): Promise<ReceiverInterface[] | null> {
try {
const receivers: ReceiverInterface[] = await Object(this.drive.getDocument(this.file.receivers.name));
const receivers: ReceiverInterface[] = await Object(this.drive.getDocument(this.file.receiver.name));
return receivers;
} catch (error) {
logger.error(error);
Expand All @@ -64,7 +64,7 @@ export class DataService {
try {
const receivers = await this.getReceivers();
receivers?.push(receiver);
await this.drive.updateDocument(this.file.receivers.name, JSON.stringify(receivers, null, 4));
await this.drive.updateDocument(this.file.receiver.name, JSON.stringify(receivers, null, 4));
return receiver;
} catch (error) {
throw new Error("Error during updating receivers list");
Expand All @@ -83,7 +83,7 @@ export class DataService {
throw new Error("UUID doesn't exist");
}
}
await this.drive.updateDocument(this.file.receivers.name, JSON.stringify(receivers, null, 4));
await this.drive.updateDocument(this.file.receiver.name, JSON.stringify(receivers, null, 4));
return true;
} catch (error) {
logger.error(error);
Expand Down

0 comments on commit 383c716

Please sign in to comment.