@insignia-education/api-sdk-js 0.16.4 → 0.16.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/api/v1/Users.js +13 -0
package/package.json
CHANGED
package/src/api/v1/Users.js
CHANGED
|
@@ -61,6 +61,19 @@ export default class Users {
|
|
|
61
61
|
* to clear the override. Returns the reloaded UserCourse, same shape as rebuildCertificate().
|
|
62
62
|
*/
|
|
63
63
|
setCustomCertificate: (courseId, url) => client.post(`${base}/${courseId}/certificate/custom`, { url }),
|
|
64
|
+
/**
|
|
65
|
+
* Employee-only: upload a hand-made PDF as this enrollment's certificate, instead
|
|
66
|
+
* of picking one already in the File Manager (setCustomCertificate) or the
|
|
67
|
+
* auto-rendered one (rebuildCertificate). Backend requires the enrollment to
|
|
68
|
+
* already be completed (completed_at set) — same rule rebuildCertificate() and
|
|
69
|
+
* setCustomCertificate() are subject to. Returns the reloaded UserCourse, same
|
|
70
|
+
* shape as the other two.
|
|
71
|
+
*/
|
|
72
|
+
uploadCertificate: (courseId, file) => {
|
|
73
|
+
const fd = new FormData();
|
|
74
|
+
fd.append('file', file);
|
|
75
|
+
return client.upload(`${base}/${courseId}/certificate/upload`, fd);
|
|
76
|
+
},
|
|
64
77
|
};
|
|
65
78
|
}
|
|
66
79
|
|