Copyleaks / plagiarism-report

Allow Copyleaks API users to view the plagiarism report using their downloaded data. Using this report allows users to view the report anytime without being restricted by the Copyleaks expiration policy (that deletes the reports data).
https://api.copyleaks.com
Other
17 stars 8 forks source link

copyleaksService.pushScanResult takes 1 argument not 2 #55

Closed mnelson4 closed 3 years ago

mnelson4 commented 3 years ago

Describe the bug The readme says to use code like this:

.subscribe(scanResult => copyleaksService.pushScanResult(result.id, scanResult));

which results in errors like this:

Error: src/app/app.component.ts:43:79 - error TS2554: Expected 1 arguments, but got 2.

43           .subscribe(scanResult => copyleaksService.pushScanResult(result.id, scanResult));

I assume that's from the older version of Copyleaks Python code. Looking at the live demo, copyleaksService.pushScanResult() should instead accept an object with keys id and result, like so:

copyleaksService.pushScanResult({id:result.id, result:scanResult}))

Also, there's a bunch of imports needed (see the demo) to get it to work.

To Reproduce Steps to reproduce the behavior: Follow readme's instructions with Angular 8 and Copyleaks version 3.1.3. Try to run ng build on an app using the component code suggested.

CL-BayanAbuawad commented 3 years ago

@mnelson4 thank you for your issue report, the issue was fixed and pushed.

if you're using angular 8, then you should use the report 2x+ version and not 3x+ as mentioned in the installation section