Update
This commit is contained in:
@@ -48,6 +48,8 @@ class OrganizationController extends Controller
|
|||||||
public function store(Request $request)
|
public function store(Request $request)
|
||||||
{
|
{
|
||||||
$organization = [
|
$organization = [
|
||||||
|
'phone' => $request->no_hp,
|
||||||
|
'email' => $request->email,
|
||||||
'code' => $request->code,
|
'code' => $request->code,
|
||||||
'name' => $request->name,
|
'name' => $request->name,
|
||||||
'type' => 'hospital',
|
'type' => 'hospital',
|
||||||
@@ -119,6 +121,8 @@ class OrganizationController extends Controller
|
|||||||
$update_organization = Organization::find($id);
|
$update_organization = Organization::find($id);
|
||||||
|
|
||||||
$update_organization->update([
|
$update_organization->update([
|
||||||
|
'phone' => $request->no_hp,
|
||||||
|
'email' => $request->email,
|
||||||
'code' => $request->code,
|
'code' => $request->code,
|
||||||
'name' => $request->name,
|
'name' => $request->name,
|
||||||
'type' => 'hospital',
|
'type' => 'hospital',
|
||||||
|
|||||||
@@ -33,6 +33,8 @@ class OrganizationResource extends JsonResource
|
|||||||
'id' => $this->id,
|
'id' => $this->id,
|
||||||
'name' => $this->name,
|
'name' => $this->name,
|
||||||
'type' => $this->type,
|
'type' => $this->type,
|
||||||
|
'no_hp' => $this->phone,
|
||||||
|
'email' => $this->email,
|
||||||
'code' => $this->code,
|
'code' => $this->code,
|
||||||
'description' => $this->description,
|
'description' => $this->description,
|
||||||
'kodeRs' => $this->meta->KodeRS ?? null,
|
'kodeRs' => $this->meta->KodeRS ?? null,
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
export type Organizations = {
|
export type Organizations = {
|
||||||
id: number;
|
id: number;
|
||||||
code: string;
|
code: string;
|
||||||
|
no_hp: number;
|
||||||
|
email: string;
|
||||||
name: string;
|
name: string;
|
||||||
address: string;
|
address: string;
|
||||||
type: string;
|
type: string;
|
||||||
|
|||||||
@@ -116,6 +116,8 @@ export default function OrganizationsForm({ isEdit, currentOrganizations }: Prop
|
|||||||
name: currentOrganizations?.name || '',
|
name: currentOrganizations?.name || '',
|
||||||
code: currentOrganizations?.code || '',
|
code: currentOrganizations?.code || '',
|
||||||
phone: currentOrganizations?.phone || '',
|
phone: currentOrganizations?.phone || '',
|
||||||
|
no_hp: currentOrganizations?.no_hp || '',
|
||||||
|
email: currentOrganizations?.email || '',
|
||||||
lat: currentOrganizations?.lat || '',
|
lat: currentOrganizations?.lat || '',
|
||||||
lng: currentOrganizations?.lng || '',
|
lng: currentOrganizations?.lng || '',
|
||||||
address: currentOrganizations?.address || '',
|
address: currentOrganizations?.address || '',
|
||||||
@@ -185,6 +187,8 @@ export default function OrganizationsForm({ isEdit, currentOrganizations }: Prop
|
|||||||
formData.append('name', data.name);
|
formData.append('name', data.name);
|
||||||
formData.append('code', data.code);
|
formData.append('code', data.code);
|
||||||
formData.append('phone', data.phone);
|
formData.append('phone', data.phone);
|
||||||
|
formData.append('no_hp', data.no_hp);
|
||||||
|
formData.append('email', data.email);
|
||||||
formData.append('lat', data.lat);
|
formData.append('lat', data.lat);
|
||||||
formData.append('lng', data.lng);
|
formData.append('lng', data.lng);
|
||||||
formData.append('address', data.address);
|
formData.append('address', data.address);
|
||||||
@@ -391,6 +395,14 @@ export default function OrganizationsForm({ isEdit, currentOrganizations }: Prop
|
|||||||
<LabelStyle>Nomor IGD</LabelStyle>
|
<LabelStyle>Nomor IGD</LabelStyle>
|
||||||
<RHFTextField name="phone" placeholder="Tuliskan No IGD" />
|
<RHFTextField name="phone" placeholder="Tuliskan No IGD" />
|
||||||
</Grid>
|
</Grid>
|
||||||
|
<Grid item xs={12} md={6}>
|
||||||
|
<LabelStyle>No. HP</LabelStyle>
|
||||||
|
<RHFTextField name="no_hp" placeholder="Tuliskan No. HP" />
|
||||||
|
</Grid>
|
||||||
|
<Grid item xs={12} md={6}>
|
||||||
|
<LabelStyle>Email</LabelStyle>
|
||||||
|
<RHFTextField name="email" placeholder="Tuliskan Email" />
|
||||||
|
</Grid>
|
||||||
<Grid item xs={12}>
|
<Grid item xs={12}>
|
||||||
<LabelStyle>Alamat</LabelStyle>
|
<LabelStyle>Alamat</LabelStyle>
|
||||||
<RHFTextField name="address" placeholder="Tuliskan Alamat" />
|
<RHFTextField name="address" placeholder="Tuliskan Alamat" />
|
||||||
|
|||||||
@@ -301,6 +301,18 @@ export default function List() {
|
|||||||
<Grid item xs={10}>
|
<Grid item xs={10}>
|
||||||
: {row.code ? row.code : '-'}
|
: {row.code ? row.code : '-'}
|
||||||
</Grid>
|
</Grid>
|
||||||
|
<Grid item xs={2}>
|
||||||
|
No. HP
|
||||||
|
</Grid>
|
||||||
|
<Grid item xs={10}>
|
||||||
|
: {row.no_hp ? row.no_hp : '-'}
|
||||||
|
</Grid>
|
||||||
|
<Grid item xs={2}>
|
||||||
|
Email
|
||||||
|
</Grid>
|
||||||
|
<Grid item xs={10}>
|
||||||
|
: {row.email ? row.email : '-'}
|
||||||
|
</Grid>
|
||||||
|
|
||||||
<Grid item xs={2}>
|
<Grid item xs={2}>
|
||||||
Rekanan
|
Rekanan
|
||||||
|
|||||||
Reference in New Issue
Block a user