mirror of
https://github.com/Dadechin/XRoomDashboardFront.git
synced 2025-07-03 00:34:35 +00:00
fix buy subscription Tab /// add other tab in components
This commit is contained in:
commit
fc622d2791
|
@ -102,6 +102,8 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import axios from 'axios';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'AddUserModal',
|
name: 'AddUserModal',
|
||||||
props: {
|
props: {
|
||||||
|
@ -139,9 +141,38 @@ export default {
|
||||||
alert('لطفاً تمام فیلدها را پر کنید.');
|
alert('لطفاً تمام فیلدها را پر کنید.');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
<<<<<<< HEAD
|
||||||
|
|
||||||
this.$emit('add-user', { ...this.newUser });
|
this.$emit('add-user', { ...this.newUser });
|
||||||
this.close();
|
this.close();
|
||||||
|
=======
|
||||||
|
|
||||||
|
const token = localStorage.getItem('token');
|
||||||
|
const userData = {
|
||||||
|
mobile_number: this.newUser.mobile_number,
|
||||||
|
first_name: this.newUser.first_name,
|
||||||
|
last_name: this.newUser.last_name,
|
||||||
|
semat: this.newUser.semat,
|
||||||
|
password: this.newUser.password,
|
||||||
|
isAdmin: this.newUser.isAdmin ? 'true' : 'false', // Sending as string "true" or "false"
|
||||||
|
};
|
||||||
|
|
||||||
|
axios.post('http://my.xroomapp.com:8000/add_teamMember', userData, {
|
||||||
|
headers: {
|
||||||
|
Authorization: `Token ${token}`,
|
||||||
|
'Content-Type': 'application/json',
|
||||||
|
},
|
||||||
|
})
|
||||||
|
.then((response) => {
|
||||||
|
console.log('کاربر جدید:', response.data);
|
||||||
|
alert('کاربر با موفقیت اضافه شد');
|
||||||
|
this.close();
|
||||||
|
})
|
||||||
|
.catch((error) => {
|
||||||
|
console.error('Error adding user:', error);
|
||||||
|
alert('خطا در افزودن کاربر');
|
||||||
|
});
|
||||||
|
>>>>>>> a042a56a6722c011d4746a55c172b4927d2b7fef
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue
Block a user