mirror of
https://github.com/HangarMC/Hangar.git
synced 2024-11-27 06:01:08 +08:00
added JsonCreator to FlagReason
This commit is contained in:
parent
22934fb7c5
commit
017d23e7fa
@ -11,7 +11,7 @@
|
||||
<v-card-text>
|
||||
<v-form ref="modalForm" v-model="validForm">
|
||||
<v-radio-group v-model="form.selection" :rules="[$util.$vc.require('A reason')]">
|
||||
<v-radio v-for="(reason, index) in flagReasons" :key="index" :label="reason.title" :value="reason.type" />
|
||||
<v-radio v-for="(reason, index) in flagReasons" :key="index" :label="$t(reason.title)" :value="reason.type" />
|
||||
</v-radio-group>
|
||||
<v-textarea v-model.trim="form.comment" rows="3" filled :rules="[$util.$vc.require('A comment')]" :label="$t('general.comment')" />
|
||||
</v-form>
|
||||
|
@ -1,7 +1,10 @@
|
||||
package io.papermc.hangar.model.common.projects;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
|
||||
import java.util.Locale;
|
||||
|
||||
public enum FlagReason {
|
||||
|
||||
INAPPROPRIATE_CONTENT("project.flag.flags.inappropriateContent"),
|
||||
@ -21,6 +24,11 @@ public enum FlagReason {
|
||||
return title;
|
||||
}
|
||||
|
||||
@JsonCreator
|
||||
public static FlagReason creator(String name) {
|
||||
return FlagReason.valueOf(name.toUpperCase(Locale.ROOT));
|
||||
}
|
||||
|
||||
private static final FlagReason[] VALUES = values();
|
||||
|
||||
public static FlagReason[] getValues() {
|
||||
|
Loading…
Reference in New Issue
Block a user