website refactor
This commit is contained in:
@@ -71,9 +71,9 @@ export class PageDataFetcher {
|
||||
entries.forEach(([key, result]) => {
|
||||
if (typeof result === 'object' && result !== null && 'success' in result) {
|
||||
if (result.success) {
|
||||
results[key as keyof T] = (result as any).data;
|
||||
results[key as keyof T] = (result as { data: T[keyof T] }).data;
|
||||
} else {
|
||||
errors[key] = (result as any).error;
|
||||
errors[key] = (result as { error: Error }).error;
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -84,4 +84,4 @@ export class PageDataFetcher {
|
||||
hasErrors: Object.keys(errors).length > 0
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user