Skip to content

Commit

Permalink
incr: fix types
Browse files Browse the repository at this point in the history
  • Loading branch information
akshayitzme committed Nov 26, 2024
1 parent 26a229d commit ccc1481
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
2 changes: 1 addition & 1 deletion fyo/model/doc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ export class Doc extends Observable<DocValue | Doc[]> {
return true;
}

get shouldDocSyncToERPNext() {
get shouldDocSyncToERPNext(): boolean {
const syncEnabled = !!this.fyo.singles.ERPNextSyncSettings?.isEnabled;
if (!syncEnabled) {
return false;
Expand Down
13 changes: 7 additions & 6 deletions src/utils/erpnextSync.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,8 @@ export function initERPNSync(fyo: Fyo) {
return;
}

const syncInterval = fyo.singles.ERPNextSyncSettings?.dataSyncInterval;
const syncInterval = fyo.singles.ERPNextSyncSettings
?.dataSyncInterval as number;

if (!syncInterval) {
return;
Expand All @@ -72,8 +73,8 @@ export async function syncDocumentsFromERPNext(fyo: Fyo) {
return;
}

const token = fyo.singles.ERPNextSyncSettings?.authToken;
const endpoint = fyo.singles.ERPNextSyncSettings?.endpoint;
const token = fyo.singles.ERPNextSyncSettings?.authToken as string;
const endpoint = fyo.singles.ERPNextSyncSettings?.endpoint as string;

if (!token || !endpoint) {
return;
Expand Down Expand Up @@ -104,7 +105,7 @@ export async function syncDocumentsFromERPNext(fyo: Fyo) {
);

await existingDoc.setMultiple(doc);
await performPreSync(fyo, doc, existingDoc);
await performPreSync(fyo, doc);
existingDoc._addDocToSyncQueue = false;

await existingDoc.sync();
Expand All @@ -125,7 +126,7 @@ export async function syncDocumentsFromERPNext(fyo: Fyo) {
try {
const newDoc = fyo.doc.getNewDoc(getDocTypeName(doc), doc);

await performPreSync(fyo, doc, newDoc);
await performPreSync(fyo, doc);
newDoc._addDocToSyncQueue = false;

await newDoc.sync();
Expand Down Expand Up @@ -497,7 +498,7 @@ export function getShouldDocSyncToERPNext(
syncSettings.supplierSyncType !== 'ERPNext to FBooks'
);

case ModelNameEnum.PriceListItem:
case 'PriceListItem':
const isPriceListSyncEnabled = !!syncSettings.syncPriceList;

return (
Expand Down

0 comments on commit ccc1481

Please sign in to comment.