Adatbázis és szinkronizációs hibajavítások
This commit is contained in:
@@ -25,7 +25,7 @@ import '../models/imported_layer_meta.dart';
|
||||
class LayerSyncService extends GetxService {
|
||||
static LayerSyncService get to => Get.find();
|
||||
|
||||
static const bucket = 'ts-layers';
|
||||
static const bucket = 'terepi_seged-layers';
|
||||
|
||||
final isSyncing = false.obs;
|
||||
|
||||
@@ -64,7 +64,7 @@ class LayerSyncService extends GetxService {
|
||||
Future<void> _pullProjectLayers(
|
||||
int localProjectId, String projectUuid) async {
|
||||
final rows = await _client
|
||||
.from('ts_layers')
|
||||
.from('terepi_seged_layers')
|
||||
.select()
|
||||
.eq('project_id', projectUuid)
|
||||
.filter('deleted_at', 'is', null);
|
||||
@@ -126,13 +126,13 @@ class LayerSyncService extends GetxService {
|
||||
|
||||
// 2. Verzió léptetése, ha már létezik a sor.
|
||||
final existing = await _client
|
||||
.from('ts_layers')
|
||||
.from('terepi_seged_layers')
|
||||
.select('version')
|
||||
.eq('id', id)
|
||||
.maybeSingle();
|
||||
final newVersion = ((existing?['version'] as int?) ?? 0) + 1;
|
||||
|
||||
await _client.from('ts_layers').upsert({
|
||||
await _client.from('terepi_seged_layers').upsert({
|
||||
'id': id,
|
||||
'project_id': projectUuid,
|
||||
'name': layer.name,
|
||||
@@ -154,7 +154,7 @@ class LayerSyncService extends GetxService {
|
||||
/// Réteg visszavonása a megosztásból (soft delete a szerveren;
|
||||
/// a lokális cache-példányok megmaradnak az eszközökön).
|
||||
Future<void> unpublishLayer(String layerId) async {
|
||||
await _client.from('ts_layers').update({
|
||||
await _client.from('terepi_seged_layers').update({
|
||||
'deleted_at': DateTime.now().toUtc().toIso8601String(),
|
||||
}).eq('id', layerId);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user