cincheo / jsweet

A Java to JavaScript transpiler.
http://www.jsweet.org
Other
1.45k stars 159 forks source link

Creating a DTO from the frontend doesn't have it's __dto_class as a property #689

Open jackymayo opened 3 years ago

jackymayo commented 3 years ago

        const newFire = FireTaskDto.createFireReport( fireReasons.map(ordinal => FireReason[ordinal]),
            FireType[FireType.CLASS],
            fireNote,
            reporter,
            studentId,
            classroomInfo,
            )

// have to manually add this
        newFire['__dto_class'] = "com.ktbyte.dto.FireTaskDto";

        fireService.reportFire(newFire, result => {
            onToggle(false);
            setIsProcessing(false);
        })

This causes a problem when trying to render enums if there are Enums in the DTO Also tried calling FireTaskDto.new{} to see, looks like it doesn't add that either Screen Shot 2021-04-29 at 6 57 13 PM