
    \FeW                         d dl mZmZmZ ddlmZmZmZmZ  e       Z	 eddgdddii	      Z
e
j                  d
      dedefd       Zy)    )	APIRouterRequestHTTPException   )MONGODB_DATABASEmongodb_connectcheck_accessget_user_subz/travelstravels  descriptionz	Not found)prefixtags	responses/requestprofile_subc                 ^  K   | j                   d   j                  d      d   }t        |d       t        t           d   j                  d|iddi      }|st        d	d
      	 t        t           d   j                  d|iddi      }|st        d	d      d|iS #  t        d	d      xY ww)zGet all my travels.authorization    
GetTravelsprofilesub_idr   r   z>The profile you are trying to get travels from does not exist.)status_codedetailr   r   zError while getting travels.zNo travels found.)headerssplitr	   mongodb_clientr   find_oner   find)r   r   
auth_tokenr   r   s        QC:\Users\ChattiNader\Documents\EpsilonGroupe\api-vastappli\app\routers\travels.pyget_travelsr%      s      177<Q?J\*-.y9BBE;CWZ_abYcdG4tuuT !129=BBMS^C_bgijakl 4GHHw	T4RSSs   A!B-$$B B-B**B-N)fastapir   r   r   utilsr   r   r	   r
   r    routergetstrr%        r$   <module>r-      sb    5 5 Q Q "	
]K01
 C w  S    r,   