Skip to content
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

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

paultrimor
Copy link

No description provided.

Copy link

@ictvision ictvision left a 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

/**
* Export all users form DB
*
* @url POST /users/csv

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

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Update on latest commit.

/**
* Import new users from into DB
*
* @url GET /users/csv

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

Copy link
Author

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';

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 ?

Copy link
Author

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

@ictvision
Copy link

One thing more, please also update API guides accordingly. i.e.

docs/api.md
docs/ApiGuide.md

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants