|
@@ -238,9 +238,11 @@ class CompilationModel extends BaseModel {
|
|
|
* */
|
|
|
async setExample(compilationId, example) {
|
|
|
let data = [];
|
|
|
- if (example) {
|
|
|
- for (let projId of example) {
|
|
|
- if (projId && projId.trim() !== "") data.push(projId.trim());
|
|
|
+ for (let projId of example) {
|
|
|
+ if (/^[0-9]+$/.test(projId)) {
|
|
|
+ data.push(parseInt(projId));
|
|
|
+ } else if (projId) {
|
|
|
+ data.push(projId);
|
|
|
}
|
|
|
}
|
|
|
return await this.updateById(compilationId, { example: data });
|