This commit is contained in:
@@ -96,7 +96,7 @@ const CommunityRolesModal: Component<CommunityRolesModalProps> = (props) => {
|
||||
const handleRoleToggle = (roleId: string) => {
|
||||
const currentRoles = userRoles()
|
||||
if (currentRoles.includes(roleId)) {
|
||||
setUserRoles(currentRoles.filter((r) => r !== roleId))
|
||||
setUserRoles(currentRoles.filter((r) => r !== roleId))
|
||||
} else {
|
||||
setUserRoles([...currentRoles, roleId])
|
||||
}
|
||||
|
||||
@@ -136,7 +136,7 @@ const InviteEditModal: Component<InviteEditModalProps> = (props) => {
|
||||
<input
|
||||
type="number"
|
||||
value={formData().inviter_id}
|
||||
onInput={(e) => updateField('inviter_id', Number.parseInt(e.target.value) || 0)}
|
||||
onInput={(e) => updateField('inviter_id', Number.parseInt(e.target.value, 10) || 0)}
|
||||
class={`${formStyles.input} ${errors().inviter_id ? formStyles.error : ''} ${!isCreating() ? formStyles.disabled : ''}`}
|
||||
placeholder="1"
|
||||
required
|
||||
@@ -165,7 +165,7 @@ const InviteEditModal: Component<InviteEditModalProps> = (props) => {
|
||||
<input
|
||||
type="number"
|
||||
value={formData().author_id}
|
||||
onInput={(e) => updateField('author_id', Number.parseInt(e.target.value) || 0)}
|
||||
onInput={(e) => updateField('author_id', Number.parseInt(e.target.value, 10) || 0)}
|
||||
class={`${formStyles.input} ${errors().author_id ? formStyles.error : ''} ${!isCreating() ? formStyles.disabled : ''}`}
|
||||
placeholder="2"
|
||||
required
|
||||
@@ -194,7 +194,7 @@ const InviteEditModal: Component<InviteEditModalProps> = (props) => {
|
||||
<input
|
||||
type="number"
|
||||
value={formData().shout_id}
|
||||
onInput={(e) => updateField('shout_id', Number.parseInt(e.target.value) || 0)}
|
||||
onInput={(e) => updateField('shout_id', Number.parseInt(e.target.value, 10) || 0)}
|
||||
class={`${formStyles.input} ${errors().shout_id ? formStyles.error : ''} ${!isCreating() ? formStyles.disabled : ''}`}
|
||||
placeholder="123"
|
||||
required
|
||||
|
||||
@@ -91,7 +91,7 @@ export default function TopicEditModal(props: TopicEditModalProps) {
|
||||
* Обработка изменения выбора родительских топиков из таблеточек
|
||||
*/
|
||||
const handleParentSelectionChange = (selectedIds: string[]) => {
|
||||
const parentIds = selectedIds.map((id) => Number.parseInt(id))
|
||||
const parentIds = selectedIds.map((id) => Number.parseInt(id, 10))
|
||||
setFormData((prev) => ({
|
||||
...prev,
|
||||
parent_ids: parentIds
|
||||
|
||||
@@ -204,7 +204,7 @@ const TopicHierarchyModal = (props: TopicHierarchyModalProps) => {
|
||||
|
||||
// Добавляем в список изменений
|
||||
setChanges((prev) => [
|
||||
...prev.filter((c) => c.topicId !== selectedId),
|
||||
...prev.filter((c) => c.topicId !== selectedId),
|
||||
{
|
||||
topicId: selectedId,
|
||||
newParentIds,
|
||||
|
||||
@@ -130,7 +130,7 @@ const TopicMergeModal: Component<TopicMergeModalProps> = (props) => {
|
||||
*/
|
||||
const handleTargetTopicChange = (e: Event) => {
|
||||
const target = e.target as HTMLSelectElement
|
||||
const topicId = target.value ? Number.parseInt(target.value) : null
|
||||
const topicId = target.value ? Number.parseInt(target.value, 10) : null
|
||||
setTargetTopicId(topicId)
|
||||
|
||||
// Убираем выбранную целевую тему из исходных тем
|
||||
|
||||
Reference in New Issue
Block a user