• Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Register
  • Login
Bagisto Forum

Bagisto

  • Register
  • Login
  • Search
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups

api for modify customer profile

General Discussion
3
11
627
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • C
    cmpengineers last edited by 10 Feb 2020, 12:31

    wow not even any one would help !!!

    1 Reply Last reply Reply Quote 0
    • J
      Jyoti last edited by 10 Feb 2020, 12:54

      @cmpengineers
      Use PUT method to update customer profile.
      Data for all required fields need to be pass to update profile

      C 1 Reply Last reply 10 Feb 2020, 13:31 Reply Quote 0
      • C
        cmpengineers @Jyoti last edited by 10 Feb 2020, 13:31

        Dear @Jyoti

        you mean i have to pass all these

        id :
        first_name:
        last_name:
        email:
        password:
        password_confirmation:
        gender:
        group :
        data_of_birth:
        phone:
        created_at:
        updated_at:

        Correct ?

        best regards

        1 Reply Last reply Reply Quote 0
        • J
          Jyoti last edited by 10 Feb 2020, 13:40

          No, need to pass only required fields and data for field that you want to update.

          C 1 Reply Last reply 10 Feb 2020, 13:42 Reply Quote 0
          • C
            cmpengineers @Jyoti last edited by cmpengineers 10 Feb 2020, 13:51 10 Feb 2020, 13:42

            Dear @Jyoti

            from where do i check the required field ? from the Customer Model ?

            Best regards

            1 Reply Last reply Reply Quote 0
            • C
              cmpengineers last edited by 10 Feb 2020, 14:12

              Dear @Jyoti

              i have found the function for the api

               $customer = auth($this->guard)->user();
              
                  $this->validate(request(), [
                      'first_name' => 'required',
                      'last_name' => 'required',
                      'gender' => 'required',
                      'date_of_birth' => 'nullable|date|before:today',
                      'email' => 'email|unique:customers,email,' . $customer->id,
                      'password' => 'confirmed|min:6'
                  ]);
              

              Route::put('customer/profile', 'SessionController@update');

              when i tried to update it give me error Route [auth.login] in Postman

              Screen Shot 2020-02-10 at 5.11.18 PM.png

              Please advise

              Best regards

              1 Reply Last reply Reply Quote 0
              • C
                cmpengineers last edited by cmpengineers 10 Feb 2020, 14:22 10 Feb 2020, 14:21

                Dear @Jyoti

                How do you authenticate (login) and at the same time modify in Postman , im confused

                Screen Shot 2020-02-10 at 5.21.37 PM.png

                1 Reply Last reply Reply Quote 0
                • C
                  cmpengineers last edited by 10 Feb 2020, 14:38

                  Dear @Jyoti

                  i managed to login and then create another link to modify its working but not sure why is asking for fields that i already is sending

                  Screen Shot 2020-02-10 at 5.21.37 PM.png

                  Best regards

                  1 Reply Last reply Reply Quote 0
                  • 10 days later
                  • J
                    Jyoti last edited by 20 Feb 2020, 07:02

                    @cmpengineers
                    Make sure that in header content type application/json is added

                    1 Reply Last reply Reply Quote 0
                    • 8 months later
                    • H
                      harismansoor last edited by 12 Oct 2020, 03:39

                      Make content-type as application/json and send put data in json formate
                      like

                      {
                              "email": "new2@email.com",
                              "first_name": "New",
                              "last_name": "Name",
                              "gender": "Male",
                              "date_of_birth": null,
                              "phone": null
                      }
                      
                      1 Reply Last reply Reply Quote 0
                      11 out of 11
                      • First post
                        11/11
                        Last post