mirror of
https://gitlab.com/davical-project/davical.git
synced 2026-02-13 03:23:34 +00:00
Correct response code for create vs update.
This commit is contained in:
parent
b1913f780a
commit
da4ef89032
@ -67,19 +67,19 @@ $params = array(
|
||||
if ( $dest->Exists() ) {
|
||||
$sql = 'UPDATE caldav_data SET caldav_data=:dav_data, dav_etag=:etag, logged_user=:session_user,
|
||||
modified=current_timestamp WHERE user_no=:user_no AND dav_name=:dav_name';
|
||||
$sync_change = 200;
|
||||
$response_code = 200;
|
||||
}
|
||||
else {
|
||||
$sql = 'INSERT INTO caldav_data ( user_no, dav_name, dav_etag, caldav_data, logged_user, created, modified, collection_id )
|
||||
VALUES( :user_no, :dav_name, :etag, :dav_data, :session_user, current_timestamp, current_timestamp, :collection_id )';
|
||||
$params[':collection_id'] = $collection_id;
|
||||
$sync_change = 201;
|
||||
$response_code = 201;
|
||||
}
|
||||
$qry->QDo( $sql, $params );
|
||||
|
||||
$qry->QDo("SELECT write_sync_change( $collection_id, $sync_change, :dav_name)", array(':dav_name' => $dest->bound_from() ) );
|
||||
$qry->QDo("SELECT write_sync_change( $collection_id, $response_code, :dav_name)", array(':dav_name' => $dest->bound_from() ) );
|
||||
|
||||
$qry = new AwlQuery('COMMIT');
|
||||
if ( !$qry->Exec('move') ) rollback(500);
|
||||
|
||||
$request->DoResponse( 200 );
|
||||
$request->DoResponse( $response_code );
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user