-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add import and export endpoints #11
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix all the mentioned points, further please note that you also need to provide an API for sample csv file i.e.
@url GET /users/sample/csv
core/Api/UserApi.php
Outdated
/** | ||
* Export all users form DB | ||
* | ||
* @url POST /users/csv |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it not supposed to be a GET API?
@url GET /users/csv
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Update on latest commit.
core/Api/UserApi.php
Outdated
/** | ||
* Import new users from into DB | ||
* | ||
* @url GET /users/csv |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it not supposed to be a POST API?
@url POST /users/csv
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Update on latest commit.
$fields = array('username', 'passwd', 'first_name', 'last_name', 'email', 'address', 'company', 'active'); | ||
$query = 'SELECT ' . implode(", ", $fields) . ' FROM usr'; | ||
$result = DB::query('usr', $query); | ||
$filepath = sys_get_temp_dir() . DIRECTORY_SEPARATOR . 'users.csv'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use random file name, tempname
function ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not sure what you mean by this. Could you please elaborate? thanks
One thing more, please also update API guides accordingly. i.e. docs/api.md |
No description provided.