Unifies naming conventions for users, companies, and rides across backend and mobile app, standardizing field names for consistency and easier data interchange. Introduces endpoints to fetch all companies and rides for sync. Enhances sync logic to support both upload and download of companies, including first-time population from server. Updates local database schema and access logic to match backend structure, improving maintainability and reliability of sync.
14 lines
392 B
TypeScript
14 lines
392 B
TypeScript
import { Router } from 'express';
|
|
import * as syncController from '../controllers/sync.controller.js';
|
|
|
|
const router = Router();
|
|
|
|
// GET routes
|
|
router.get('/companies', syncController.getCompanies);
|
|
router.get('/rides', syncController.getRides);
|
|
|
|
// POST routes
|
|
router.post('/companies', syncController.syncCompanies);
|
|
router.post('/rides', syncController.syncRides);
|
|
|
|
export default router;
|